Layer normalization

Deep learning · Formula · Not yet linked from a lesson

LN(x)=γ⊙x−μσ2+ϵ+β\mathrm{LN}(\mathbf{x}) = \gamma \odot \frac{\mathbf{x} - \mu}{\sqrt{\sigma^2 + \epsilon}} + \beta

Standardises each example across its own features, then lets the model rescale and shift the result. Because it never looks across the batch, it behaves identically at batch size one — which is why transformers use it and not batch norm.

Symbols

μ\mu
The mean over the feature dimension of this example.
σ2\sigma^2
The variance over the same dimension.
γ\gamma
A learned per-feature scale.
β\beta
A learned per-feature shift.
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark