4.10.20 · D3Advanced Topics (Elite Level)

Worked examples — Gradient descent and variants — convergence analysis

2,329 words11 min readBack to topic

Before anything: three words we will keep using, pinned to a picture.


The scenario matrix

Every cell below is a distinct behaviour GD can exhibit. Each is claimed by exactly one example.

Cell Input class What makes it special Example
A , round bowl converges in ONE step Ex 1
B large, thin canyon crawls, zig-zags Ex 2
C step diverges (oscillates outward) Ex 3
D step exactly boundary: neither grows nor shrinks Ex 4
E , flat bottom () convex but only , sublinear Ex 5
F momentum on cell B turns into Ex 6
G noisy gradients (SGD) constant leaves a residual ball Ex 7
H real-world word problem pick from data (logistic-style) Ex 8
I exam twist: negative eigenvalue not convex — GD escapes/diverges Ex 9

Sign coverage note. The one-step contraction factor is . We will meet it positive (, cell B), zero (, cell A), negative but (overshoot yet converge, Ex 4 discussion), equal to (boundary, cell D), below (divergence, cell C), and with (non-convex, cell I). Every sign is shown.


Ex 1 — Cell A: the perfectly round bowl ()

The contraction factor here is exactly zero — the boundary between the positive-factor world (Ex 2) and the overshoot world (Ex 4).


Ex 2 — Cell B: the thin canyon (large )

Figure — Gradient descent and variants — convergence analysis

Ex 3 — Cell C: too big a step ⟹ divergence

Figure — Gradient descent and variants — convergence analysis

Ex 4 — Cell D: the exact boundary

Sign ledger so far: Ex 1 factor , Ex 2 factor , Ex 4 factor , Ex 3 factor . The remaining sign — factor , overshoot yet converge — happens for any ; e.g. here gives factor , converging while alternating sides.


Ex 5 — Cell E: the flat bottom (, sublinear)

Figure — Gradient descent and variants — convergence analysis

Ex 6 — Cell F: momentum turns


Ex 7 — Cell G: noisy gradients (SGD residual ball)


Ex 8 — Cell H: real-world word problem (choose from data)


Ex 9 — Cell I: the exam twist (negative curvature, non-convex)


The completed matrix

Every cell A–I now has a worked, verified example. The contraction factor has appeared with value (Ex 1), in (Ex 2), (Ex 4), (Ex 3), with (Ex 3), and with (Ex 9); the degenerate case (Ex 5), the noisy case (Ex 7), and a data-driven step (Ex 8) round out every scenario.

Recall Quick self-test

Which cell converges in one step, and why? ::: Cell A (): factor when . For , how many iterations does GD need to cut error 10×? ::: About 115; momentum needs about 11.5. What is the exact step size at which GD oscillates forever without progress? ::: (factor ). Why does constant- SGD not reach the exact minimum? ::: Noise injects variance each step, leaving a residual ball. What breaks all convergence guarantees in Ex 9? ::: A negative eigenvalue (): no safe , GD diverges.

Related build-up: Convex Functions and Optimization, Lipschitz Continuity, Eigenvalues and the Condition Number, Taylor's Theorem and the Fundamental Theorem of Calculus.