First smooth a noisy signal. Then apply the same memory idea to an actual
gradient path and inspect every measure, remember, and move step.
Memory
Keep 90% of the previous memory; add 10% of today’s reading.
Signal
Before day 1m₀ = 0
→
First readingm₁ = x₁
Choice used in this signal plot: seed the smoother at
the first observation, then apply
mₜ = βmₜ₋₁ + (1−β)xₜ from day 2 onward. The momentum section
instead applies its recurrence immediately from m₀ = 0.
The same 120 readings, one adjustable memory
daily readingconstructed trendEWMA through today
Click the plot or use ← → to choose a day
One number is carried forward
m stands for memory. mt is
the running summary after reading day t;
m0 is its state before any reading.
Retained memory—
Today’s contribution—
New memory—
Use memory to filter a changing gradient direction
In this computed ravine, one coordinate is one hundred times steeper.
Plain gradient directions swing across the valley. Momentum blends
successive gradients before moving.
Plain GD uses only today’s gradient, so its step shrinks as the
remaining error shrinks. Momentum keeps part of earlier, agreeing
gradients—like repeated pushes in the same direction.
Across the valley the gradient flips sign. Old and new contributions
oppose each other, so the stored direction becomes much smaller.
actual update 2 in θ₂: plain GD +1.5746 · momentum +.2642
Both methods use the same learning rate,
η = .0195. Momentum starts with a smaller move because m₀ = 0 gives
m₁ = .75g₀. From update 2 onward, it blends old and new directions.
The rolling-ball picture is an intuition, not a literal force law.
Before the first gradientθ₀ = (−1.4, .35) · θ* = (1, −.5) · m₀ = (0, 0)m means gradient memory. We start it at zero because
no earlier gradient exists—not because the current gradient is zero.
Parameter space and model predictions move together
path so farmeasured descent direction −gₜretained −.25mₜsum −mₜ₊₁actual move −.0195mₜ₊₁
Start before update 1
first update · step 1 of 6
Startθ₀ = (−1.4000, .3500); m₀ = (0, 0)
Measure—
Keep—
Add—
Combine—
Move—
The first two updates, without skipping a line
The first update creates memory. The second shows what cancellation means numerically.
Along the valley: the θ₁ gradient components stay negative, so
their memory reinforces. Across the valley: .25(63.75) =
15.9375 and .75(−39.3125) = −29.484375 partly cancel, leaving
m₂,₂ = −13.546875 rather than another large swing.
Reveal the computed trajectory one update at a time
Rows appear only after the stepper reaches them. Loss is evaluated at θₜ, before that row’s move.