How to calculate a logistic sigmoid function in Python?

后端 未结 15 1872
情话喂你
情话喂你 2020-11-29 16:14

This is a logistic sigmoid function:

\"enter

I know x. How can I calculate F(x

15条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 17:02

    Another way by transforming the tanh function:

    sigmoid = lambda x: .5 * (math.tanh(.5 * x) + 1)
    

提交回复
热议问题