I knew the formula conceptually but fumbled the epsilon term placement under the square root.
Start by clarifying the scope: training vs. inference, and whether to include backpropagation. Then implement the forward pass for training (compute batch mean and variance, normalize, scale and shift) and inference (use running averages), and optionally the backward pass. Finally, discuss trade-offs and edge cases.
Pro tip: Mention that in inference, you use the running mean and variance computed during training, not the current batch statistics. Also, highlight the importance of numerical stability by adding a small epsilon to the variance.
Ask whether the implementation should include both forward and backward passes, and whether it's for training or inference. Confirm if they want a complete layer or just the normalization function.
Compute batch mean and variance along the feature dimension. Normalize inputs using these statistics, then apply learnable scale (gamma) and shift (beta) parameters.
Use running averages of mean and variance (computed during training) to normalize inputs. This ensures deterministic outputs at test time.
Derive gradients with respect to inputs, gamma, and beta. Use the chain rule and account for the batch statistics' dependence on inputs.
Talk about computational cost, memory usage, and behavior with small batch sizes. Mention alternatives like layer normalization and why batch norm may not suit recurrent networks.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.