Optimization for Data Science · Lecture 14
Subgradient convergence and proximal methods
Watch averaging control the subgradient method, see what a proximal step minimizes, and combine a gradient step with shrinkage or projection.
1 Subgradient convergence through averaging
Run the subgradient method on the example from Lecture 13. Compare the moving iterate with its weighted average and the upper bound proved in Lecture 14.
f(w̄k) − f⋆ ≤ [D² + G² Σj=0k−1 ηj²] / [2 Σj=0k−1 ηj], D = ‖w₀‖₂.
Iterates and weighted average
Diamonds are level sets of f. Both axes have the same scale.
Objective convergence and the guarantee
The bound applies to the weighted average of w₀,…,wk−1.
The one-step estimate and telescoping argument
‖wj+1 − w⋆‖² ≤ ‖wj − w⋆‖² − 2ηj(f(wj) − f⋆) + ηj²G².
Sum from j = 0 to k − 1. The intermediate squared distances cancel. Dropping −‖wk−w⋆‖², dividing by 2Σηj, and applying convexity gives the displayed bound. At k = 0 the average is undefined.
The start is w₀ = (1, 0.65). At a zero coordinate this demo chooses subgradient 0 for the first coordinate and 2 for the second. Every step uses a valid subgradient. The horizon-tuned step stays fixed throughout the run. The logarithmic plot places gaps at or below 10⁻⁵ on the bottom row; readouts retain the actual values.
2 What does the proximal map minimize?
Move the input v or change η. The quadratic term anchors the solution near v, while the absolute-value term pulls it toward zero.
The proximal subproblem
The green point minimizes the sum of the blue and orange curves.
Soft thresholding
Every input in [−η, η] maps exactly to zero.
Optimality condition from the notes
w⁺ = proxηh(v) ⇔ (v − w⁺)/η ∈ ∂h(w⁺).
For h(z) = |z|, the subdifferential at zero is [−1, 1]. The proximal point equals zero exactly when v/η belongs to this interval. At a positive proximal point the selected subgradient is 1; at a negative point it is −1.
3 A forward step followed by shrinkage or projection
Minimize a quadratic loss with either an ℓ₁ penalty or a disk constraint. Inspect each forward and backward step while watching the full trajectory converge.
Trajectory in parameter space
Contours show the smooth loss f. The cross marks the composite minimizer.
Objective convergence
Observed gap F(wₖ) − F⋆ for the selected quadratic example.
The model, the two proximal maps, and “backward”
Here f(w) = ½(w−a)ᵀQ(w−a), where a = (2, ½) and Q has rows (2, 1) and (1, 2). Its gradient is 3-Lipschitz. The start is w₀ = (0.8, −0.6), and each run uses the same fixed η.
For h(w) = λ‖w‖₁, shrink each coordinate of zₖ by ηλ, stopping at zero. For h = ι_C with C = {w : ‖w‖₂ ≤ R}, the proximal map is the Euclidean projection onto C.
wk+1 = wk − η[∇f(wk) + gk], gk ∈ ∂h(wk+1).
The smooth gradient is evaluated at the current point; the nonsmooth subgradient is evaluated at the next point. The logarithmic gap plot uses 10⁻¹² as its bottom row. Values smaller than this share that row; readouts retain the computed gap.