Skip to content
StackDecode
AI & ML Atlas
Neural NetworksoptimiserInteractive simulation

Momentum Optimisation

Gradient descent with a rolling "velocity" that smooths the path and speeds up valleys.

The idea

Keep a velocity that accumulates past gradients, like a ball rolling downhill. Components of the gradient that keep pointing the same way build up speed, while components that flip sign cancel out. This damps zig-zagging across a narrow valley and speeds progress along it.

v ← μv + g, θ ← θ − η 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/61

Loss landscape seen from above: a long narrow valley. Final loss 0.0005.

Step by step

  1. 1Compute the gradient.
  2. 2Update the velocity: v ← μv + g.
  3. 3Move the parameters: θ ← θ − η·v.
  4. 4Repeat.

Where it is used

SGD with momentum is a strong default in vision.

Watch out for

Too much momentum overshoots and oscillates.

Related