Batch normalisation
You will learn
How batch norm puts features on different scales on one scale, and what it uses at inference.
Features on different scales pull a network around: in the spec's batch one feature is ten times another. Batch normalisation subtracts each feature's batch mean and divides by its spread, so the features 1, 2, 3, 4 and 10, 20, 30, 40 both come out as -1.34, -0.45, 0.45 and 1.34, and -1, -1, 1, 1 comes out as -1 and 1. A learned gamma and beta then scale and shift it back where that helps. At inference the layer uses running averages instead of the batch: with mean 0, variance 1, gamma 1 and beta 0.25, the inputs 1, 2 and 3 give 1.25, 2.25 and 3.25. The spec batchnorm_layer.t27 computes both.