The four that matter, and their derivatives
What the forward pass sees is the function. What training sees is the derivative, and that is what decides whether a network learns.
The sigmoid squashes to the range 0 to 1. Its derivative peaks at 0.25 and falls towards zero in both directions.
Tanh is the same shape centred on zero, with a peak derivative of 1, which is why it beat sigmoid in hidden layers for years.
ReLU is not a squash at all. Its derivative is exactly 1 on the positive side, so the gradient passes through unchanged however deep the stack is.
GELU multiplies the input by the probability that a standard normal is below it, giving a smooth curve that is ReLU-like for large values and gently negative near zero.
Why the derivative decides everything
Backpropagation multiplies one derivative per layer, so a value below 1 at every layer shrinks the product geometrically.
With sigmoid at its best, ten layers multiply ten factors of at most 0.25, which is before any weight is considered.
With ReLU those factors are 1 wherever the unit is active, and the product does not decay at all. That is the whole reason deep networks became trainable.
What ReLU costs
A unit pushed permanently negative receives no gradient, so it can never recover. It is dead for the rest of training.
Leaky ReLU leaves a small slope on the negative side so there is always something to learn from.
ReLU is also not smooth at zero, and the subgradient used there is an arbitrary choice that in practice costs nothing.
Choosing one
- Hidden layers in a convolutional or fully connected network: ReLU, unless something is going wrong.
- Hidden layers in a transformer: GELU or SwiGLU, which is what every current model uses.
- Binary output: a single sigmoid, producing one probability.
- Multiclass output: softmax over the classes, not a sigmoid each.
- Regression output: nothing at all, so the network can print any real number.
The one that is not an activation function
Softmax takes a whole vector and returns a distribution over it, so it couples every unit to every other one.
The three above act on one number at a time, which is why they can be applied to a million-element tensor in one pass with no reduction.
Putting softmax in a hidden layer is almost always a mistake. It forces the layer's outputs to sum to one, which is a constraint nothing there asked for.