liveBook · Manning

Layer normalization

As explained in Deep Learning with Python, Third Edition

Layer normalization standardizes neural-network activations across specified feature dimensions for each example independently, often applying learned scale and bias parameters.

Layer normalization normalizes sequence data independently for each sequence, rather than collecting statistics across a batch. That makes it a practical alternative to batch normalization in a Transformer encoder. section 15.3.2

A Transformer encoder

An encoder block applies LayerNormalization after self-attention and again after its feedforward network. The layer preserves the input and output shape, allowing encoder blocks to be stacked. section 15.3.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines sequence-wise normalization, contrasts it with batch normalization, and shows pseudocode and encoder-layer placement.
Examples
Demonstrates normalization with NumPy-like pseudocode and shows Keras LayerNormalization layers in an encoder block.
What you can do after
Apply it via Keras LayerNormalization layers in a Transformer encoder block.
How it connects
Connects layer normalization to batch normalization, Transformer encoders, self-attention, and residual connections.

Also explained in

Compare how 7 books explain layer normalization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.