AI & ML Atlas
Neural NetworkstechniqueInteractive simulation
Layer Normalisation
Normalises across the features of one example instead of across the batch.
The idea
For each example separately, subtract the mean and divide by the standard deviation computed over its own features. It does not depend on batch size and behaves the same in training and inference, which is why transformers and RNNs use it.
y = γ · (x − μ)/√(σ² + ε) + β (μ, σ over features)
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- positive
- negative
The same numbers. Layer norm treats each sample (row) on its own, so it does not depend on the batch.
- step:
- raw
1/4
Layer norm statistics come along each row (across features).
Step by step
- 1For one example compute the mean and variance over its features.
- 2Normalise each feature.
- 3Apply a learnable gain and bias.
Where it is used
Transformers and recurrent networks.
Watch out for
Slightly less effective than batch norm for CNNs.