> *The sigmoid function is the S-curve that turns messy reality into neat probabilities—a mathematical diplomat that insists every answer must be between 0 and 1.*
The Sigmoid (Logistic) transformer maps any real-valued input to the bounded range (0, 1) using the standard logistic function. Its characteristic S-shaped curve makes it indispensable for probability estimation, neural network activations, and any scenario requiring bounded outputs from unbounded inputs.
## Mathematical Foundation
### Core Formula
$$
S(x) = \frac{1}{1 + e^{-k(x - x_0)}}
$$
where:
- $x$ is the input value
- $k$ is the steepness factor (default 1.0)
- $x_0$ is the midpoint where $S(x_0) = 0.5$ (default 0.0)
1.**Not Exactly 0 or 1**: Sigmoid asymptotically approaches but never reaches 0 or 1. If you need exact binary outputs, apply a threshold post-sigmoid.
2.**Vanishing Gradients**: For very large or small inputs, $S'(x) \approx 0$. This is a feature for boundedness but can cause issues if the sigmoid is part of a learning system.
3.**Scale Sensitivity**: The default $k=1$ assumes inputs are roughly in the range $[-5, 5]$. For inputs with different scales, adjust $k$ or normalize inputs first.
4.**Midpoint Confusion**: Remember $x_0$ shifts where 0.5 occurs, not where 0 occurs. Sigmoid never outputs exactly 0.
5.**Symmetry Assumption**: Sigmoid imposes symmetric transition behavior. For asymmetric responses, consider other activation functions.
## Validation
| Test | Status |
|:-----|:------:|
| **Midpoint S(x₀) = 0.5** | ✅ |
| **Symmetry Property** | ✅ |
| **Range (0, 1)** | ✅ |
| **Monotonicity** | ✅ |
| **Steepness Effect** | ✅ |
| **Limit Behavior** | ✅ |
| **Overflow Guards** | ✅ |
## References
- Verhulst, P.-F. (1838). "Notice sur la loi que la population suit dans son accroissement." *Correspondance Mathématique et Physique*.
- Rumelhart, D., Hinton, G., & Williams, R. (1986). "Learning representations by back-propagating errors." *Nature*.