Chapter 8 needed exactly the right weight scale to keep a deep network stable. What if a layer could just fix its own scale, no matter what came before it?
Same broken scale from Chapter 8 — the faint line still vanishes exactly as before. The bold line is the same network with one thing added after every layer: batch normalization. It barely moves.
Batch normalization re-centers and rescales a layer's output across a batch of examples, at every layer, regardless of what produced it:
- — neuron 's output after normalization, mean and variance by construction.
- — neuron 's raw output, before normalization.
- — the mean of neuron 's output, measured across the current batch.
- — the variance of neuron 's output, measured across the current batch.
- — a tiny constant that keeps the division from blowing up when the variance is near zero.
- Mean 0, variance 1 — by construction
and are simply the mean and variance of neuron 's output, measured across the current batch. Plug them in and every neuron comes out with mean and variance — by construction, not by hoping the weight scale happened to be right.
Drag the scale anywhere — tiny, huge, exactly ideal. The faint line swings across nine orders of magnitude. The bold one barely leaves . Batch norm doesn't care what scale produced the input; it forces the output to a fixed scale every time.
- Without batch norm, at scale 0.05
Six layers shrink the RMS (short for Root Mean Square) activation from about down to under — dead, exactly as in Chapter 8.
- With batch norm, at every scale tried
Insert batch normalization after each layer instead, and every single layer's RMS activation comes out within about of exactly — from all the way to .
- Compare the spread
The five-scale spread in final-layer RMS with batch norm is under , compared to nine orders of magnitude without it.
Pick a scale that would badly break the network without batch norm — then confirm the batch-normalized version stays healthy anyway.
Batch norm doesn't fix a bad weight scale — it makes the weight scale stop mattering, by re-establishing a healthy activation distribution at every layer regardless of what arrived there. That's also why training got noticeably more forgiving of learning rate and initialization choices once batch norm became standard. The next chapter looks at a completely different kind of fix — one aimed not at unstable activations, but at a network that's learned its training data a little too well.