Batch Normalisation
Rescales each layer's activations to zero mean and unit variance across the batch.
The idea
For every feature, subtract the batch mean and divide by the batch standard deviation, then apply a learnable scale γ and shift β. This keeps activations in a well-behaved range, allows larger learning rates, speeds training and acts as a mild regulariser. At test time it uses running averages.
y = γ · (x − μ_B)/√(σ²_B + ε) + β
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- positive
- negative
A batch of 6 samples with 5 features. The columns have very different averages and spreads, which makes training unstable.
- step:
- raw
Batch norm statistics come down each column (across samples).
Step by step
- 1Compute the mean and variance of each feature over the batch.
- 2Normalise: x̂ = (x − μ) / √(σ² + ε).
- 3Scale and shift: y = γ x̂ + β.
- 4Keep running averages for inference.
Where it is used
Convolutional networks.
Watch out for
Behaves poorly with tiny batches and in recurrent networks.