Sigmoid function (source code)

= Sigmoid function
{wiki}

A sigmoid function has an S-shaped graph, typically increasing between finite lower and upper limits. The standard <logistic function>, often called \i[the sigmoid] in <neural networks>, is
$$
\sigma(x)=\frac1{1+e^{-x}},\qquad \sigma'(x)=\sigma(x)(1-\sigma(x)).
$$
The <hyperbolic tangent> is another sigmoid: $\tanh x=2\sigma(2x)-1$. Thus sigmoid names a broader family than the logistic formula alone. Logistic outputs lie in $(0,1)$ and can represent a <binary classification> probability, but using this <activation function> alone does not ensure that the fitted probabilities are calibrated. Its derivative tends to zero in both tails, one mechanism behind the <vanishing gradient problem>.