How to calculate a logistic sigmoid function in Python?

后端 未结 15 1825
情话喂你
情话喂你 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:12

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

    The above code is the logistic sigmoid function in python. If I know that x = 0.467 , The sigmoid function, F(x) = 0.385. You can try to substitute any value of x you know in the above code, and you will get a different value of F(x).

提交回复
热议问题