Start with ReLU. Try GELU or SiLU when smooth gating improves optimization.
Nonlinearity gives depth
something to learn.
Without nonlinear activations, stacked linear layers collapse into one linear map. The function’s shape controls sparsity, saturation, smoothness, and gradient flow.
h = activation(Wx + b)ReLU
f(x) = max(0, x)Strong default for hidden layers, especially CNNs and MLPs.
Zero gradient for negative inputs can create dead units.
Rectifying units appeared in early neural models and were popularized for deep networks around 2010–2011 because they trained more reliably than saturating sigmoids.
GELU and SiLU are common defaults; architecture conventions matter.
Sigmoid for independent binary outcomes; softmax for one categorical outcome.
Softplus for variance, scale, concentration, or rate without a hard zero kink.
Next lesson
From likelihood to loss
Derive MSE, MAE, and cross-entropy as negative log-likelihoods of observation models.
Follow the derivation