What does batch normalisation do to the values a layer produces, and why does it help training? What are the new values if a feature takes the values and in a mini-batch?
Deep learning, Normalisation
Level L1 Beginner. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can say in plain words that batch normalisation re-centres and re-scales each feature across a mini-batch.
Key idea
For each feature, batch normalisation subtracts the mean of the mini-batch and divides by its standard deviation. The values then have mean and spread , which keeps the layer's inputs on a steady scale and makes training more stable.
Steps
- A mini-batch is a small group of training examples processed together. For one feature, take its values across that group. Say they are and .
- Find the mean and the spread: the mean is . Each value sits away from the mean, so the standard deviation (the typical distance from the mean) is .
- Subtract the mean and divide by the standard deviation: and . The new values are centred on with spread . (Real implementations add a tiny number under the division to avoid dividing by zero.)
- Why this helps: later layers always see inputs on a similar scale, so training can use larger learning rates and is less sensitive to starting weights. The layer also learns two small knobs, a scale and a shift, so it can undo the normalisation if that works better.
Common mistakes
- Thinking it normalises across the different features of one example. Batch normalisation works across the examples of a mini-batch, one feature at a time.
- Thinking it only rescales. It also re-centres, by subtracting the mean.
How long your answer should be
3–5 sentences, about 1 minute.
Read this
Previous in Deep learning: What is dropout in a neural network, why does randomly switching off neurons during training reduce overfitting, and what happens at test time?
Next in Deep learning: What does it mean that a convolutional layer "shares" one small filter across the whole image, and why does that suit images? How many weights does one filter need, compared with one fully connected neuron looking at a greyscale image?