Adaptive scaling
A supplied second moment rescales its coordinate gradient through the stated square-root divisor.
On this page 8 sections
- Overview
- Different model parameters can experience very different gradient scales
- Step size depends on both gradient magnitude and its coordinate divisor
- A second moment is not a standard deviation
- The second moment tracks squared gradient size, not centered variance
- Key takeaway
- Sources & further reading
- Concept connections
01Different model parameters can experience very different gradient scales#
Different model parameters can experience very different gradient scales. Adaptive methods use a separate running scale estimate for each coordinate, so one large-gradient coordinate need not dominate every update. The denominator in these tasks is supplied, not estimated from the current gradient alone.
Adaptive scaling gives each coordinate its own divisor. Here the supplied second moments satisfy s≥0, ε sits outside the root, and every denominator must be positive:
For θ=(4,3), g=(2,4), s=(1,9), η=1 and ε=1, the divisors are (2,4). Equal steps (1,1) give θ′=(3,2).
For parameter , gradient , second moments , rate 1, and , take square roots and add epsilon to get divisors . Divide matching gradient entries to get . Subtract from the parameter to obtain .
Use coordinatewise. θ=, g=, s=, η=0.5, ε=1. Find θ′.
Show answer and explanation
Steps: (1,1).
02Step size depends on both gradient magnitude and its coordinate divisor#
Step size depends on both gradient magnitude and its coordinate divisor. Equal gradients can produce unequal steps when their supplied moments differ.
Compare absolute step magnitudes when direction is irrelevant; a negative gradient still creates a positive magnitude.
Use coordinatewise. g=, s=, η=1, ε=0. Find |step1|/|step2|.
Show answer and explanation
Magnitudes 1.5 and 0.75; ratio 2.
03A second moment is not a standard deviation#
A second moment is not a standard deviation. Apply the square root in the stated rule, then add ε in the stated location.
Some algorithms place ε differently. Do not silently substitute another convention or treat an uncentered second moment as centered variance.
Use coordinatewise. (θ,g,s,η,ε)=(5, 8, 9, 1, 1). Draft uses s+ε without √s. Correct θ′.
Show answer and explanation
Root s first, add ε, then divide: θ′=3.
04The second moment tracks squared gradient size, not centered variance#
The second moment tracks squared gradient size, not centered variance. The root returns it to gradient-scale units; epsilon keeps the stated divisor positive. Its placement inside or outside the root changes the arithmetic, so use the exact convention shown.
Use each coordinate’s own s, preserve the stated ε location, and subtract the resulting scaled gradient.
- Compute an update with supplied per-coordinate second-moment scaling.
Sources & further reading
- [1]D2L §12.8.1, alongside Adam Algorithm1 for epsilon outside the square root ↗D2L §12.8.1, alongside Adam Algorithm1 for epsilon outside the square root · Article
- [2]Kingma & Ba Algorithm1 ↗Kingma & Ba Algorithm1 · Article