Batch normalized gradient norm
Penguin learning project
The project uses 342 complete Palmer penguin records: 240 training-pool and 102 held-out rows. The selected training rows determine feature scaling and model parameters. Source CSV
This project trains weights with softmax, unlike the homepage lab, which uses nearest species averages. Same penguin measurements; different classification methods. Predictions can differ.
Batch normalization · Describe batch normalization and its derivatives.
The project uses a linear rule with two features. The fitted weights produce scores or normalized mass.
Consider this concept alongside the project; its source assumptions may differ. These observations do not prove a theorem.
Input: 12 × 2; Held-out evaluation: 102 · #58 · 40.6 mm, 193 mm. Known answer: Adélie; Prediction: Adélie · [≈0.7383, ≈0.2444, ≈0.01737].
Used in these source sections: 6.4 Adjusting the scale
The gradient formula removes the mean direction and the normalized-batch direction from the incoming gradient.
These operations define structured network layers and their analysis.
Source formula example
illustration · The invented finite inputs illustrate this expression. They do not prove a general identity, bound, or existence claim.
Symbols
- Real batch vector of length m.
- Positive batch standard deviation.
- Real scale.
- Differentiable scalar loss.
- Normalized batch with zero shift and unit scale.
- Vector of ones.
Source formula example
This source example uses its own inputs and assumptions. Editing it does not change the project.
Edit a value or the code, then run the example. This is a finite demonstration, not a proof of the paper’s theorem.
This example’s data flow
Code changed. Reset to restore this example’s data flow.
You choose
input.gamma= 1
Initial values in code
g=[1, 0, 1]
Calculated here
Result expression: { gradient, squaredNorm, rightSide }
sigma=Math.sqrt(2 / 3)z=[-1 / sigma, 0, 1 / sigma]Uses:sigmameanComponent=dot([1, 1, 1], g) / 3Uses:dot,gnormalizedComponent=dot(z, g) / 3Uses:dot,z,ggradient=g.map( (v, i) => (input.gamma / sigma) * (v - meanComponent - normalizedComponent * z[i]), )Uses:g,input.gamma,sigma,meanComponent,normalizedComponent,zsquaredNorm=dot(gradient, gradient)Uses:dot,gradientrightSide=(input.gamma ** 2 / (sigma * sigma)) * (dot(g, g) - dot([1, 1, 1], g) ** 2 / 3 - dot(z, g) ** 2 / 3)Uses:input.gamma,sigma,dot,g,z
Returns
gradient- array (3 items): [≈0.4082, ≈-0.8165, ≈0.4082]
squaredNorm- 1
rightSide- 1
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
Use batch [−1,0,1], r(z) = z₁+z₃, and γ as shown. The gradient of this linear loss is [1,0,1] everywhere, so it agrees at b and at the normalized output. The code computes the chain-rule gradient using the Jacobian and both sides of the squared-norm identity. the source proposition takes m ≥ 2, real β and γ, and differentiable r. The formula requires σb > 0 even though the displayed source statement says every batch; constant batches make its denominator zero. The printed source uses ∇r(b); for general nonlinear r the usual chain rule evaluates the incoming gradient at B(b), so that printed argument may need clarification.
Source: Source expression