Momentum, Nesterov momentum and learning rate schedules
10 questions on momentum, the effective learning rate, Nesterov momentum and decay schedules that shrink the step over time. With explanations.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
In a stretch of the error surface where the gradient hardly changes, a run uses a base learning rate of 0.01 and a momentum parameter of 0.9. What is the step size it effectively approaches?
- About 0.01, the same as without momentum
- About 0.1, ten times larger
- About 0.9, close to the momentum value
Sample 2
A linear schedule lowers the learning rate in a straight line from 0.1 to 0.01 over 90 steps. What is it at step 45?
- 0.01
- 0.05
- 0.1
- 0.055
How it works
- One question per screen. An answer is final once sent.
- You see right away whether you were right, with a short explanation.
- The stopwatch runs: on equal scores, the faster player ranks first.
- Only your best attempt counts, so replaying is never risky.
About this quiz
A heavy ball rolling down a rough, bumpy slope does not stop and restart at every ridge. Its inertia carries it over small bumps, smooths out the jolts, and keeps it moving along the general direction of the slope. Momentum brings exactly that property to gradient descent. Instead of obeying only the gradient at the current point, each step also remembers part of the previous one. The result is a method that races along gentle slopes and calms down in zig-zags, and it has been a standard ingredient of network training for years.
This quiz examines how momentum works and what it costs. You will see what the extra term does when the gradient keeps pointing the same way, and what it does when the gradient flips from side to side. You will see why the effective step can grow without the training becoming unstable, and what new setting appears in return. The quiz also covers a refinement that changes the order of two operations, and when that refinement is useful.
The second half is about how the step size should change over time. Early in training, large steps cover ground quickly. Later, near a minimum, the same steps would bounce around, so smaller ones are better. A learning rate schedule is a rule for lowering the step as training proceeds, and there are several popular shapes. The questions ask about the shapes, about how the settings are chosen, and about the cheap diagnostic that tells you whether the schedule is working.
Typical errors are worth knowing before you start. Adding momentum without lowering the base learning rate can make a stable run unstable. Treating the momentum setting as something to copy blindly from another project can waste a lot of time. And thinking that a schedule has an official best form misses the point that its values are found by experiment and observation. These two ideas together explain a good deal of everyday training practice. When a recipe says to use a certain momentum and to decay the rate after some number of steps, it is applying inertia to cope with uneven curvature and shrinking the step to settle accurately at the end. Seeing the reason behind each choice lets you adapt a recipe to a new model with confidence, instead of hoping that borrowed numbers happen to fit, and it helps you recognise which of the two is at fault when a run misbehaves.
The quiz suits learners who understand plain gradient descent and its zig-zag problem, and practitioners who use momentum and schedules from habit. It uses a little arithmetic with round numbers. There are 10 questions, each with an explanation, and it takes about four minutes.
Questions and answers
›How long does the quiz take?
About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. After every answer you get an explanation, which also shows the arithmetic when numbers are involved.
›What should I know beforehand?
It helps to know that gradient descent takes steps against the slope and that too large a step makes it unstable. The quiz on valleys and the learning rate covers that background. Everything else, including the meaning of the momentum setting, is introduced in the questions.
›What is momentum in gradient descent?
It is an extra term in the update that adds a fraction of the previous step to the current one. The fraction is the momentum parameter. A step is therefore a mixture of what the gradient says now and where the weights were already heading. It gives the motion inertia, so it is less easily thrown off course by a single noisy or misleading gradient.
›Why does momentum help in a narrow valley?
Across the valley, the gradient keeps changing sign, so the contributions from consecutive steps tend to cancel and the sideways motion is damped. Along the valley floor, the gradient keeps the same sign, so contributions add up and the motion speeds up. The method therefore suppresses the unwanted part of the movement and amplifies the useful part.
›What is the momentum parameter and what value is typical?
It is a number between zero and one. At zero the method reduces to plain gradient descent, and as it approaches one the past dominates more and more. A value around nine tenths is common in practice. It adds a second setting to tune next to the learning rate, and the two interact, so changing one often means revisiting the other.
›What is Nesterov momentum?
It is a variation in which the order of operations is swapped. Ordinary momentum measures the gradient at the current position and then adds the inertia. Nesterov momentum first applies the inertia, moves to the look-ahead position, and measures the gradient there. It tends to help most when the gradient is exact, as in batch methods, and less when the gradient is noisy.
›What is a learning rate schedule?
It is a rule that makes the learning rate a function of the step number. Commonly it starts high and falls, for example by a straight line over a fixed number of steps, by a power law or by an exponential decay. The starting value, the final value and the length or speed of the decay are settings that have to be found by experiment.
›How do I know if a schedule is working?
Plot the learning curve, which shows the error as training proceeds, and watch it. A healthy curve falls steadily and then flattens as the rate decreases. Wild swings suggest the rate is too high at that stage, and a curve that barely moves suggests it is too low. Monitoring the curve costs almost nothing and is the standard way to tune the schedule.