Batch normalization (BN) standardizes activations with statistics computed from the current batch, then uses learned parameters γ and β to scale and shift them. It often accelerates convergence and improves accuracy without increasing representational capacity. section 6.2.1 section 6.2.3 section 6.2.7
Choose the normalization dimensions and PyTorch module from the tensor shape:
- For (B, D) fully connected data, compute each feature’s mean and standard deviation across the B batch items; use torch.nn.BatchNorm1d(D). section 6.2.2
- For (B, C, D), normalize each channel across B × D values; use torch.nn.BatchNorm1d(C). section 6.2.2
- For (B, C, W, H) or higher-dimensional channel data, normalize over channels with BatchNorm2d or BatchNorm3d. section 6.2.2
- During inference, use running estimates accumulated from earlier batches so predictions do not depend on other examples; batch size one is unsuitable for training BN. section 6.2.2
Adding BN to fully connected and convolutional networks
Insert nn.BatchNorm1d(n) after each nn.Linear layer in a fully connected network, or nn.BatchNorm2d(out_filters) after each nn.Conv2d layer in a CNN, before the activation. The Fashion-MNIST example uses batches of 128 and compares BN models with earlier ReLU baselines. section 6.2.3
Figure 6.1 Three versions of a network with three hidden layers and one output layer: (a) the normal approach we have learned thus far; (b) and (c) two different ways to add a normalization layer
Use the network diagrams to compare an ordinary layer stack with architectures that insert normalization layers. section 6.2.1








