AI & ML Atlas
Neural NetworksoptimiserInteractive simulation
Nesterov Accelerated Gradient
Momentum that looks ahead before computing the gradient.
The idea
Ordinary momentum computes the gradient where you are, then adds the velocity. Nesterov first jumps ahead along the velocity and computes the gradient at that look-ahead point. The correction arrives earlier, so it slows down before overshooting a minimum.
v ← μv − η ∇L(θ + μv)
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- current weights
- minimum
- last update
Start somewhere on the bowl. Rings are lines of equal loss; the minimum is at the centre.
- step:
- 0
- loss:
- 3.4617
1/29
Loss landscape seen from above: a long narrow valley. Final loss 0.0003.
Step by step
- 1Compute the look-ahead point θ + μv.
- 2Evaluate the gradient there.
- 3Update the velocity: v ← μv − η·g.
- 4Move: θ ← θ + v.
Where it is used
Training with SGD where momentum helps.
Watch out for
Another hyper-parameter (μ) to tune.