Sigmoid & Tanh: Squashing to a Range
Bounded outputs and the vanishing-gradient trap.
Squashing Activations
Some activations squeeze any input into a fixed range. The two classics are sigmoid and tanh, and both bend big numbers gently inward. 🤏
Sigmoid's Range
Sigmoid maps every value into the open interval from 0 to 1. That makes its output read naturally as a probability.
import torch
y = torch.sigmoid(x) # outputs between 0 and 1All lessons in this course
- Why Nonlinearity Unlocks Real Power
- ReLU and Its Leaky & GELU Cousins
- Sigmoid & Tanh: Squashing to a Range
- Softmax for Probabilities