Activations drift in scale and offset as earlier layers change during training. Batch normalization (Ioffe & Szegedy, 2015) renormalizes each feature across the mini-batch, which stabilizes and speeds up training.
Implement batchnorm_train(x, gamma, beta, eps), which normalizes each feature with the batch mean and variance, then applies the learned scale and shift. Return the output along with the mean and variance it used.
x has shape (N, D).N.Compute mean and var over axis 0, normalize with sqrt(var + eps), then apply gamma * x_hat + beta.
No results yet
Run your code to check it against the examples, or submit to run every test.