y=1+e−x1 The Logistic (Sigmoid) Function y=1+e−x1
The logistic function y=1+e−x1, also called the standard sigmoid, is the archetypal S-shaped curve1. It confines the output between 0 and 1 whatever the real input, which makes it well suited to representing a probability or a degree of being on or off.
Domain and range
- The domain is all real numbers
- The range is the open interval (0,1)
- It increases monotonically
- The lines y=0 and y=1 are horizontal asymptotes
The denominator 1+e−x is always positive, and the values at the two ends are never reached.
Symmetry
Since f(−x)=1−f(x), the graph has point symmetry about (0,21).
| x | f(x) | f(−x) | Sum |
|---|
| 1 | ≈0.7311 | ≈0.2689 | 1 |
| 2 | ≈0.8808 | ≈0.1192 | 1 |
| 4 | ≈0.9820 | ≈0.0180 | 1 |
Monotonicity
The function has the striking property that its derivative can be written in terms of itself.
f′(x)=f(x)(1−f(x))=(1+e−x)2e−x It is always positive, so the function increases over the whole line. The slope is greatest at the center x=0, where it equals 41. Where the value is near 0 or 1 the slope is almost 0, and that is what leads to the vanishing gradient in deep networks.
Inflection point
The second derivative is f′′=f(1−f)(1−2f), whose sign changes at f=21, that is at x=0. The point (0,21) is the only inflection point, and the curve turns there from concave up to concave down.
Relation to the hyperbolic tangent
f(x)=21(1+tanh2x) It coincides with tanh widened by a factor of 2 horizontally, halved vertically and lifted by 21.
| Item | 1+e−x1 | tanhx |
|---|
| Range | (0,1) | (−1,1) |
| Center of symmetry | (0,21) | (0,0) |
| Slope at the origin | 41 | 1 |
They are the same shape, differing only in range and scale.
Applications and history
In the nineteenth century the Belgian mathematician Verhulst introduced it as the solution of the logistic equation, which models the growth of a population in an environment of limited resources.
- The model of a probability in logistic regression
- An activation function in neural networks
- Population growth and the progress of a chemical reaction
- Logistic function, Wikipedia