Lesson 5 of 14 9 min · 153 words
Activation functions: sigmoid, tanh, ReLU
Their shapes, ranges and gradients.
Sigmoid : range (0, 1), smooth, good for output probabilities. In hidden layers its gradient (at most 0.25) shrinks towards zero for large — saturation — causing vanishing gradients in deep networks. Outputs are not zero-centred.
Tanh : range (−1, 1), zero-centred, stronger gradients than sigmoid (max 1) — but it still saturates.
ReLU : gradient is 1 for positive inputs and 0 for negative. Cheap, doesn't saturate for positive values, and made deep networks practical. Risk: 'dying ReLU' — a neuron stuck in the negative region never updates. Leaky ReLU (), ELU and GELU fix this.
- Default for hidden layers: ReLU (or GELU in transformers).
- Binary output: sigmoid. Multiclass output: softmax. Regression output: linear (no activation).
Formula to remember
Backpropagation
Errors flow backwards via the chain rule.
Quick check · +5 XP