liveBook · Manning

Batch normalization

As explained in Deep Learning with JAX

A neural-network normalization layer that normalizes activations using batch statistics during training and stored running statistics during inference.

Want faster training and better model performance? Batch normalization normalizes layer activations, then learns how to scale and shift them. section 11.2.1

Batch normalization changes behavior between training and inference:

  • During training, calculate each activation’s batch mean and variance, normalize by standard deviation, then apply learned scale and shift parameters. section 11.2.1
  • Maintain exponential moving averages of mean and variance separately from learned parameters. section 11.2.1
  • During inference, use the stored averages and fixed learned scale and shift values, even for a single input. section 11.2.1

In Flax, treat the running statistics as model state rather than ordinary parameters; training updates that state through a mutable model-state path.

How Deep Learning with JAX covers it

How deep it goes
Explains normalization, learned transformations, running statistics, and separate training and inference behavior.
Examples
Demonstrates normalization inside a ResNet block and tracks its state during initialization and training.
What you can do after
Apply it via Flax by separating learned parameters from mutable batch-statistics state during training.
How it connects
Connects activation normalization with backpropagation, model state, inference, and layer, group, and instance normalization.

Also explained in

Compare how 9 books explain batch normalization →

Related concepts

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