Dr. Santanu Pal ∇Optimization LabLecture 7 · Guided algorithm steps

INTERACTIVE
Space: play · ← →: step

Teach with the lab

Begin with the dimension and objective at the top. Read the algorithm on the right, then use Step to execute one highlighted line. The live substitution gives its numerical result. The parameter point moves only when the update line is executed. Finish iteration completes the current update; Play executes the lines automatically. Settings restart the demonstration.

The symbols follow your slides

WhereSymbolsMeaning
Slide 19θ, A, B, MOne scalar parameter; left/right bracket endpoints and midpoint.
Slide 21θ, Δθ, t, t*Parameter vector, descent direction, trial step size and chosen step size. Here t is not an iteration index.
Slides 22–25k, ρₖ, p*, μ, L, c, εIteration, objective error, optimal value, curvatures, bound factor and allowed error.
Slides 29–37t, τ, iHere t counts iterations, τ is learning rate, and i identifies a parameter coordinate.
Slides 33–35γ, βThe same memory coefficient, written γ in the base momentum slide and β in the variants slide.
Slides 36–37gₜ, Gₜ, mₜ, vₜCurrent gradient, accumulated squared gradients, first moment, and second moment.
SlidesDemonstrationTry this in class
19BisectionLocate M, evaluate f′(M), then decide which half to keep. Read the corrected midpoint stopping certificate in the algorithm.
21GD + line searchMatch θ + tΔθ on the 2D contour with the same trial t on the 1D curve φ(t) = f(θ + tΔθ).
22–25ConvergenceIncrease L while keeping μ fixed. Compare the measured error with the guaranteed bound.
26–27Parallel gradientsStep through broadcast, local gradients, sum, and update. The regularizer is added once.
29–32Learning rateFind the threshold between shrinking oscillations and growing oscillations.
33–35MomentumPause and compare the new gradient contribution with the stored movement. Locate Nesterov’s look-ahead point.
36AdaGradWatch the squared-gradient sum and effective learning rate for each coordinate.
37AdamCompare first and second moments. Toggle bias correction at the first update.
38Compare optimizersChange the landscape or learning rates. Ask why the ranking changes.
29–38GD to Adam: equationsPlay the equation journey. Read why a term is added, compare the equations, then watch the numerical effect. Next method changes the concept being taught.
42–43Newton: Taylor & updateBuild the constant, linear and quadratic parts. Minimize the local model, then place the updated point on the true objective.
44Newton: parallel costAggregate local gradients and Hessians, then solve. Increase dimension to see dense storage and factorization scaling.
46–48SGD: sample & updateUse n = 128 and |S| = 32. Compare the batch loss, scaled estimate and exact full loss; change sum to mean with the corresponding learning-rate conversion.
49–50Perceptron & marginInspect a correct prediction whose margin is still too small. Explain why it receives an update.
51SGD: convergence & noiseCompare a single noisy run, an average of 40 runs and the exact expectation. Switch from diminishing to constant steps.
52Logistic regressionCompute score, probability, loss and gradient before updating. Change the right plot to inspect the two-dimensional weight path.

Read the visuals accurately

Use alongside Beamer

Each topic has its own URL ending in its topic name. A Beamer link can open that topic in your browser:

\href{YOUR-LAB-URL/#momentum}{Open momentum demonstration}

The downloadable single-file edition also runs locally without an internet connection. Keep it beside your lecture PDF and open it in your browser before class.

Sources

Mapped to Lec_7_Optimization.pdf, the supplied lecture. Numerical methods reference: Boyd & Vandenberghe, Convex Optimization; Duchi, Hazan & Singer, AdaGrad (2011); Kingma & Ba, Adam (ICLR 2015).