What each activation function computes
An activation function is applied to each neuron's weighted sum so a network can learn nonlinear patterns. This calculator evaluates eleven common choices at any x and returns both f(x) and the derivative f'(x), the quantity backpropagation multiplies into every gradient.
- Sigmoid 1 / (1 + e^(-x)) squashes to (0, 1). Sigmoid(1) = 0.731059.
- Tanh squashes to (-1, 1) and is zero centered, with slope 1 at x = 0.
- ReLU max(0, x) and Leaky ReLU, which keeps a small slope (0.01 by default) for negative inputs.
- ELU alpha(e^x - 1) for x at or below 0, and SELU, a scaled ELU with lambda = 1.0507009873554805 and alpha = 1.6732632423543772.
- GELU x times the standard normal CDF, used in BERT and GPT style transformers, and Swish/SiLU x times sigmoid(x).
- Softplus ln(1 + e^x), a smooth ReLU whose derivative is exactly the sigmoid, and Mish x times tanh(softplus(x)).