The interactive film is in the book's Companion

Play it, pause it, turn it and drag it with Mathematics for AI and Machine Learning.

Get the book

Backtracking Line Search and the Armijo Condition

Chapter 12 · Mathematics for AI and Machine Learning · Advanced · 1:55

An interactive live film: a curtain above the negative-gradient ray shows the loss along one step and the Armijo line; trial steps halve until one is accepted. Find where a full step passes at once.

Narration

Here is the bowl from the gradient descent section: one half of x one squared plus five halves of x two squared. Its largest curvature is five, so a fixed step converges only below two over five.

Take a step a little too large. Along the steep direction the factor is now below minus one, so each step flips the sign and grows: the red path climbs out of the valley.

The rest of the narration is in the book's Companion.

More from Chapter 12

Interactive1:08Gradient Descent in an Ill-Conditioned ValleyChapter 12Preview1:28The Descent Lemma: A Bowl That Bounds Every StepChapter 12Preview1:33Heavy-Ball Momentum: Zig-Zags Cancel, the Valley Floor Adds UpChapter 12Preview1:43A Large Step Selects a Flatter MinimumChapter 12Preview2:12Sophia: Newton Steps with a ClipChapter 12Preview2:14Adam and AdamW: A Step Size for Every CoordinateChapter 12Preview1:50Proximal Gradient and Soft-Thresholding: Exact ZerosChapter 12Preview1:53KKT Conditions: the Saddle Point of the LagrangianChapter 12Preview1:52Mirror Descent Stays Inside the SimplexChapter 12Preview1:55The Polyak-Łojasiewicz ConditionChapter 12