Loading...
Implement the sigmoid (logistic) function that maps any real number to the range (0,1).
σ(z)=1+e−z1
Given a list of values, apply the sigmoid function to each and return the results.
To avoid overflow for large negative values, use the identity: for z<0, compute σ(z)=1+ezez.
Round each result to 4 decimal places.
z = [0, 2, -2]
[0.5, 0.8808, 0.1192]