REVISION AND PRACTICE
Week 4 Quick Revision
On this page 6 headings
Swipe long formulas, tables or code sideways to see the rest.
Start here All of Week 4 on one page: why plain gradient descent is slow, momentum, NAG, stochastic/mini-batch versions, learning-rate tips and line search.
- Gradient descent steps are slope → tiny steps on gentle slopes.
- Contour maps: lines close together steep, far apart gentle.
- Momentum: remember past gradients fast on flat regions, but overshoots with U-turns.
- NAG: measure the gradient at the look-ahead point → shorter U-turns.
- SGD / mini-batch: update after 1 / B points → many more updates per epoch, but noisy.
- Learning rate: search on a log scale, decay over time, or pick per step with line search.
| Method | Update |
|---|---|
| Gradient descent | |
| Momentum | |
| Momentum unrolled | |
| NAG | |
| Exponential decay | |
| 1/t decay | |
| Step decay | halve every few epochs, or when validation error rises |
| Sutskever momentum |
| Algorithm | Steps in 1 epoch |
|---|---|
| Batch (vanilla) GD | 1 |
| SGD | N |
| Mini-batch GD | N / B |
| Method | Speed on flat regions | Oscillations | Cost per step |
|---|---|---|---|
| GD | slow | none (true gradient) | full data |
| Momentum | fast | big U-turns | full data |
| NAG | fast | smaller U-turns | full data |
| SGD | many cheap steps | very noisy | 1 point |
| Mini-batch | balance | reduced noise | B points |
| Line search | faster than fixed | some (from picks) | several loss evaluations |
- In the code, is inside ; in the formula it is outside. Same result for a fixed .
- The momentum code on the slide writes “” — it should be uw (typo).
- The exponential decay slide prints “”; the standard formula is .
- turns momentum back into plain gradient descent.
- A larger batch reduces, but never fully removes, the oscillations (unless ).
- The lecture’s title also lists AdaGrad, RMSProp and Adam, but these slides end at line search — the adaptive methods are in the next set of lectures.
Exam words: plateau, contour, momentum, exponentially weighted average, NAG, look-ahead, stochastic gradient descent, mini-batch, epoch, step, learning rate, annealing, step/exponential/1/t decay, line search.
