Monash University · FACULTY OF COMPUTER SCIENCE

ECE5179 Chap.3 Gradient Descent and Optimisation Geometry

- one subject, every graph, every model, every mark
7 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 3 of 12 · ECE5179

Gradient Descent and Optimisation Geometry

Week 3 explains how large models are trained when no closed-form solution exists. The gradient points uphill and is orthogonal to the level sets, so stepping against it decreases the loss for a small enough learning rate.

The chapter covers the update rule, stopping criteria, critical points and convexity, convergence rates, and how to diagnose a learning rate from a loss curve, ending with the momentum update listed on the formula sheet.

In this chapter

What this chapter covers

  • 01

    Why grid search fails in high dimensions

  • 02

    The gradient as the direction of steepest ascent

  • 03

    Level sets and why paths zigzag in narrow valleys

  • 04

    The gradient-descent update and stopping criteria

  • 05

    Critical points, convexity and global minima

  • 06

    Sublinear and linear convergence

  • 07

    Learning-rate diagnosis and momentum

Worked example · free

Gradient descent on a quadratic and the best learning rate

Q [6 marks]. For f(w) = 2w² − 8w + 5 starting at w = 0 with learning rate 0.1, run three iterations, then find the learning rate that reaches the minimum in one step and the range that converges. We set this mark allocation for revision only; it is not an official University scheme.
Loss against iteration for four learning rates.Loss against iteration for four learning rates. All runs start at w = 0 where f = 5; η = 0.25 reaches the minimum −3 at once, while η = 0.45 overshoots back and forth before settling.η = 0.05η = 0.1η = 0.25η = 0.45 oscillatesminimum f = −3iteration kloss f(w)
Loss against iteration for four learning rates. All runs start at w = 0 where f = 5; η = 0.25 reaches the minimum −3 at once, while η = 0.45 overshoots back and forth before settling.
  • 1Derivative f′(w) = 4w − 8, so the first step gives w = 0 − 0.1 × (−8) = 0.8.
  • 1Second step: f′(0.8) = −4.8, so w = 0.8 + 0.48 = 1.28.
  • 1Third step: f′(1.28) = −2.88, so w = 1.28 + 0.288 = 1.568.
  • 1The minimiser is w* = 8/4 = 2, and each update multiplies the distance w − 2 by 1 − 4η.
  • 1One-step convergence needs 1 − 4η = 0, so η = 0.25.
  • 1Convergence needs |1 − 4η| < 1, so 0 < η < 0.5.
The iterates are 0.8, 1.28 and 1.568, approaching the minimum at 2 by a factor of 0.6 per step. A learning rate of 0.25 lands on the minimum immediately, and any rate between 0 and 0.5 converges.
Sia tip — For a quadratic, write the contraction factor 1 − η f″ first; its sign and size predict monotone, oscillating or divergent behaviour before you iterate.
Glossary

Key terms

Level set
A level set is the collection of points at which a function takes one fixed value.
Critical point
A critical point is a point where the gradient is zero or does not exist.
Convex function
A convex function lies on or below every chord joining two points on its graph.
Momentum
Momentum accumulates past gradients in a velocity vector and steps along that velocity instead of the raw gradient.
FAQ

Gradient Descent and Optimisation Geometry FAQ

How do I tell from a loss curve whether the learning rate is too big?

A rate that is too large makes the loss oscillate, rise or diverge, while a rate that is too small gives a slow, steady decline. A good rate falls quickly and then levels off. If two curves start from the same loss, they share an initialisation, so differences come from the step size.

Does a zero gradient mean I have found the minimum?

Not necessarily. Minima, maxima and saddle points all have zero gradient, so a stationary point needs further checking. For convex losses such as those of linear or logistic regression every local minimum is global, but networks with hidden units are not convex and gradient descent offers no guarantee there.

Why does gradient descent zigzag in a narrow valley?

The gradient is steep across the valley and gentle along it, so one learning rate overshoots in the steep direction while creeping in the shallow one. The path bounces from wall to wall. Momentum helps because opposing components cancel across steps while consistent ones accumulate.

What does momentum add to plain gradient descent?

Momentum keeps a running velocity that adds each new gradient to a fraction β of the previous velocity, then steps along the velocity. Components that point the same way step after step accumulate speed, while components that flip sign across a narrow valley partly cancel, which damps the zigzag that plain gradient descent shows.

Why not simply search a grid of parameter values?

The number of grid points grows exponentially with the number of parameters, so even a coarse grid is impossible for a network with millions of weights, and a grid can step straight over a narrow minimum. Gradient descent instead uses the local slope to choose a direction, at a cost that grows only linearly with the parameter count.

How should I choose when to stop gradient descent?

The notes list several stopping tests: the gradient norm falling below a tolerance, the change in the loss becoming tiny, the change in the parameters becoming tiny, or a fixed iteration budget running out. The function value can flatten before the parameters settle, so a gradient-norm test is often the more reliable signal.

Study strategy

Exam move

Practise the update rule on one-dimensional quadratics until you can predict the behaviour from the factor 1 − η f″ alone, then repeat on a two-variable bowl with different curvatures in each direction and sketch the path. Compute gradients at a point for mixed functions, such as products of polynomials with sine or tanh, writing each partial derivative separately.

Finally, draw loss-against-iteration curves for a small, a good and a large learning rate and annotate what each shape tells you. For the convergence-rate vocabulary, attach one concrete example to each term: an error of 1/k is sublinear, an error shrinking by 0.6 each step is linear, and a ratio that falls to zero is superlinear.

In written answers, name the rate and justify it from the error sequence rather than from a remembered label.

Working through Gradient Descent and Optimisation Geometry in ECE5179? Sia is AskSia’s AI Computer Science tutor — ask any ECE5179 Gradient Descent and Optimisation Geometry question and get a clear, step-by-step explanation grounded in how ECE5179 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 161 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your ECE5179 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
ECE5179 · Neural networks and deep learning - independent study guide on the AskSia Library. More Monash University subjects · Microeconomics across all universities