Batch norm needs a batch of examples to compute statistics, which is awkward for sequence models and batch size 1. Layer normalization (Ba, Kiros & Hinton, 2016) computes the statistics across the features of each example instead.
Implement normalize_last_axis(x, eps), which normalizes each example over its feature dimension.
(..., D).Use axis=-1 with keepdims=True so each example's mean and variance broadcast back correctly.
No results yet
Run your code to check it against the examples, or submit to run every test.