How to calculate a logistic sigmoid function in Python?

后端 未结 15 1802
情话喂你
情话喂你 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 16:54

    Use the numpy package to allow your sigmoid function to parse vectors.

    In conformity with Deeplearning, I use the following code:

    import numpy as np
    def sigmoid(x):
        s = 1/(1+np.exp(-x))
        return s
    

提交回复
热议问题