ContentsThe library

The Mathematics of Gradient Descent

What Momentum Multiplies Your Step Size By

Last timeWhy Descent Zigzags

Momentum is a geometric sum of past gradients. Working out what that sum converges to explains both why it helps and why it needs a smaller learning rate.

The last lesson diagnosed the problem. In a stretched bowl the sharp directions

reverse on every step while the flat direction keeps pointing the same way.

That suggests an obvious repair: instead of using the current gradient, use an

accumulation of the recent ones, so that the reversals cancel and the agreements

add up.

That is momentum, and it takes two lines.

FIG 1The momentum update
the gradient at the current point
the velocity, an accumulation of every gradient so far
the momentum coefficient, between zero and one, usually 0.9
the learning rate, which now multiplies the velocity rather than the gradient
A second quantity is carried between steps. The gradient no longer moves the parameters directly; it changes the velocity, and the velocity moves the parameters.

The physical name is a distraction. Unroll the recursion and the velocity is

just a weighted sum:

vk=gk−1+βgk−2+β2gk−3+⋯v_k = g_{k-1} + \beta g_{k-2} + \beta^2 g_{k-3} + \cdots

Every past gradient is present, discounted by β\beta raised to its age. With

β=0.9\beta = 0.9 a gradient from ten steps ago still carries about a third of its

original weight, and one from fifty steps ago carries half a percent. The

velocity is a memory roughly 1/(1−β)1/(1-\beta) steps deep.

The lesson stops here

8 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01Why the Steepest Direction Is the Negative Gradient
  2. 02Why the Gradient Is Computed Backwardsopening only
  3. 03The Largest Step a Curvature Will Tolerateopening only
  4. 04One Ratio Decides How Long Training Takesopening only
  5. 05What Momentum Multiplies Your Step Size Byyou are here
  6. 06The Gradient You Use Is Always the Wrong Oneopening only
  7. 07Dividing by the Size of Your Own Gradientsopening only
  8. 08The Variance That Keeps a Deep Network Aliveopening only

Read alongside