The standard logistic function is encoded as sigmain the following code:
from sympy import *
x, sigma = symbols("x sigma")
sigma = 1/(1 + exp(-x))
plot(sigma);

When you try to calculate the area below the curve for negative x:
integrate(sigma,(x, -oo, 0))
If you need the correct answer, you need to calculate the next limit, which gives log(2), as it should be.
t = symbols("t")
limit(integrate(sigma, (x, -t, 0)), t, oo)
Why SymPydoesn't sigma integrate correctly?
source
share