Skip to content
StackDecode
AI & ML Atlas
Neural NetworkstechniqueInteractive simulation

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.

2.910.710.514.420.5-1.56.112.715.717.30.87.56.415.515.7-1.19.78.91915.7-5.112.67.72016.8-4.814.50.92512.9features →samples ↓
  • positive
  • negative

A batch of 6 samples with 5 features. The columns have very different averages and spreads, which makes training unstable.

step:
raw
1/4

Batch norm statistics come down each column (across samples).

Step by step

  1. 1Compute the mean and variance of each feature over the batch.
  2. 2Normalise: x̂ = (x − μ) / √(σ² + ε).
  3. 3Scale and shift: y = γ x̂ + β.
  4. 4Keep running averages for inference.

Where it is used

Convolutional networks.

Watch out for

Behaves poorly with tiny batches and in recurrent networks.

Related