Batch normalization does not make a distribution Gaussian
Updated
Subtracting a mean and dividing by a standard deviation changes a set of values' location and scale. It does not change an arbitrary distribution into a bell curve. That distinction corrects an overstatement in my batch-normalization notebook.
This note concerns the hidden activations of an MLP, not biological neurons' firing rates.
The operation for one feature
For a batch of values, define
Here stabilizes the denominator; and are learned scale and offset parameters. The normalization above uses the population-form batch variance, with denominator . Library conventions for running variance estimates can differ from the forward-pass convention.
An illustrative counterexample
Illustrative values: take a batch . Its mean and population variance are both . Ignoring just for this arithmetic demonstration, its normalized values are . There are still only two distinct values. Nothing has made their distribution Gaussian.
With nonzero , the normalized variance is , not exactly one. After the learned affine transform, neither zero mean nor unit variance is guaranteed.
Training and inference are different
During training, the statistics depend on other examples in the batch. At inference, a conventional batch-normalization layer uses stored running estimates so a prediction does not depend on the other examples submitted alongside it. Forgetting evaluation mode can therefore change model behavior.
A running average of standard deviations is also not interchangeable with the square root of a running average of variances. When replacing handwritten code with a library layer, check the precise equations and defaults.
Batch normalization can help optimization, but this note does not claim it always helps or explain its benefits solely through one proposed mechanism. The original method is described by Ioffe and Szegedy in Batch Normalization. The exercise comes from Karpathy's makemore series.