Neural Networks
Running the forward pass…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Neural Networks
Running the forward pass…
Subtract the mean, divide by the spread, then let γ and β put back what training wants. Batch norm and layer norm, computed on a batch small enough to read, and what they do to a deep network.
| u1 | u2 | u3 | u4 | |
|---|---|---|---|---|
| ex 1 | 0.8 | −4.6 | −0.6 | 0.6 |
| ex 2 | 1.5 | −4.3 | −2.6 | 0.8 |
| ex 3 | 2.4 | −0.3 | 0.7 | 1.0 |
| ex 4 | 2.0 | 0.7 | −0.4 | 0.0 |
| ex 5 | 3.6 | −2.4 | −2.4 | 1.0 |
| ex 6 | 2.6 | 1.0 | −0.1 | −0.7 |
A layer's pre-activations for a batch of 6 examples: one row per example, one column per unit, so X has shape [6, 4]. Each unit lives on its own scale: unit 2's values span 5.60, unit 4's only 1.70, and their averages run from −1.65 to 2.15. Whatever comes next has to cope with all of that, and with it shifting as earlier layers train. Batch norm re-centres and rescales each unit using this batch's own numbers.