Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Every activation function, compared

Sigmoid, tanh, ReLU, leaky ReLU, ELU, GELU, and SiLU -- one family, one decision rule for which to reach for.

Default to ReLU for a hidden layer -- it's cheap, it doesn't saturate for positive inputs, and it's the safest first choice for a new architecture. Switch to leaky ReLU or ELU if training reports dead units (a large fraction of activations stuck at exactly zero, contributing no gradient). Reach for GELU or SiLU in a Transformer or any architecture where a smooth, non-monotonic activation has been shown to outperform ReLU empirically -- both are the default in modern large-scale models. Sigmoid and tanh are rarely a hidden-layer default today; keep sigmoid for a final binary-classification output and tanh where a zero-centered, bounded activation is specifically wanted (a gate inside an LSTM cell, for instance). Whatever the choice, the question that should follow it immediately is: does this function saturate, and if so, where?

The classic pair

A nonlinear function applied to a neuron's weighted sum, letting a network represent more than a straight line.

The nonlinearity every hidden layer needs -- without one, any stack of layers collapses to a single linear map.

A region where an activation function's output barely changes as its input changes, making its gradient near zero.

Example

A sigmoid unit fed an input near \pm 6 has a gradient close to 0 -- learning there has effectively stalled.

ReLU and its variants

An activation function that outputs its input unchanged if positive, and zero otherwise.

Example

\mathrm{ReLU}(-2)=0, \mathrm{ReLU}(3)=3.

The modern, smooth alternatives

The decision itself

Graph settings

Calculator