Proximal methods (ISTA, FISTA) and ADMM
Before this lesson: lesson 03 (the step and the rate), lesson 04 (Nesterov momentum, which FISTA uses), lesson 08 (KKT conditions, projections, the lasso dual); why the norm gives sparse solutions (linear algebra 11). Time: about 75 minutes, plus the notebook.
Why this matters #
Many objectives in ML and science have the form , with a smooth data term and a simple nonsmooth term :
- the lasso and sparse logistic regression (feature selection);
- total variation in imaging, denoising and geophysical inversion;
- constraints: bounds on physical parameters, nonnegative factors, probability vectors.
The subgradient method handles the kink of only slowly (error after steps) and gives no exact zeros. The proximal gradient method keeps the rate of gradient descent, gives exact zeros, and accelerates to . ADMM splits a problem into pieces that are each easy. This is how large inverse problems, distributed fitting, and "plug-and-play" priors (a learned denoiser, even a diffusion model, used in place of a proximal step) are solved.
1. Predict first #
2. The picture #
2.1 A smooth part plus a simple part #
Write , where
- is convex and -smooth (lesson 02): its gradient exists and does not change faster than ;
- is convex but may be nonsmooth or even take the value , and it is simple: the small problem in section 2.2 has a cheap, exact solution.
The indicator function of a set is if and otherwise. Adding to turns "minimize over " into "minimize over everything". So constraints are a special case of a nonsmooth .
Why not use gradient descent with a subgradient of (a slope of a supporting line, section 3)? At a kink the subgradient jumps, the step size must shrink to 0, and the iterates jump around 0 without landing on it. The method is slow and the solution is never exactly sparse.
2.2 The proximal operator #
The proximal operator of with step is
Read it as: move from to a point where is small, but do not go far. A small keeps you close to ; a large cares mostly about . For convex the objective in is strongly convex, so the minimizer exists and is unique.
Three cases in one dimension.
- , the indicator of an interval: the prox is the closest point of the interval, . A prox generalizes a projection.
- : the prox moves toward 0 by and stops at 0 if it would cross it. This is soft thresholding:
Every is mapped to exactly 0. This is where exact sparsity comes from.
- : the prox is , a shrinkage by a constant factor. It never reaches 0 unless .
Move and . Left: the two parts of the prox objective, (violet) and (blue, dashed), and their sum (black). The orange point is the minimizer . Right: the prox map with the identity dashed. For , the yellow dead zone is sent to exactly 0: the kink at 0 holds the minimizer there. For the map is a line through 0 with slope ; for the indicator it is a clip.
What is for , and ?
Soft thresholding gives . The point is in the dead zone . Moving by the full would cross 0, and the kink of stops the minimizer at exactly 0; it never overshoots to .
is the indicator of the interval . What is for ?
The prox objective is outside and inside, so the minimizer is the point of closest to 1.7, which is 1. For an indicator the step does not matter: for every .
2.3 Proximal gradient: a gradient step, then a prox step #
Recall the descent lemma (lesson 02): for an -smooth and a step , the parabola
lies above and touches it at . Keep exact, replace by this upper bound, and minimize over . Complete the square (the terms that do not depend on drop out):
So the minimizer of "upper bound of " is
A gradient step on , then a prox step on . Because we minimize an upper bound of that touches at (this is called majorize–minimize), cannot go up: . In numerical-analysis words, it is a forward (explicit) Euler step on and a backward (implicit) Euler step on : forward–backward splitting. The implicit step handles the kink of stably.
Projected gradient. If for a closed convex set , the prox is the projection , and the method becomes projected gradient descent:
Examples of cheap projections: a box (clip each entry), the nonnegative orthant (, the ReLU), a ball (rescale), the probability simplex (lesson 08).
Drag the blue start point and press Play. Each step is a gradient step (blue, dashed), which may leave the set, followed by a projection back onto the yellow set . The iterates reach the boundary and then slide along it to the constrained minimizer (black star). The grey star is the unconstrained minimizer, outside . At , (grey arrow) points straight out of : no feasible direction goes downhill. Try the disc, and a step above 2.
3. Definitions and main results #
Subgradients and the optimality condition #
For a convex function , a vector is a subgradient of at if
The line (or plane) with slope through lies below the graph. The set of all subgradients is the subdifferential . If is differentiable at , . For the absolute value:
At the kink, every slope between and gives a supporting line. Two facts we use:
- A convex has a global minimum at if and only if . (Take in the definition: for all .)
- If is convex and differentiable, .
Lemma (prox optimality) #
For a closed, proper, convex (its graph has no gaps at the boundary, and it is not everywhere), the minimizer is unique, and
Proof. The prox objective is strongly convex, so it has exactly one minimizer. By the sum rule its subdifferential is . The minimizer is where this set contains 0, that is .
Soft thresholding from the lemma. Take in one dimension and write . We need . Check the three cases:
- : , so . This is consistent only if .
- : , so . Consistent only if .
- : we need .
Together: . The norm is a sum over coordinates, so its prox acts coordinate by coordinate.
Projection from the definition. If , the prox objective is on and outside. So for every .
Theorem (minimizers are fixed points) #
Let be convex and differentiable, and closed, proper and convex. For any ,
Why it is true (intuition). At a minimizer, the gradient step wants to move by , and the prox step pulls back by exactly the same amount. The two forces balance, as in the KKT picture of lesson 08.
Proof.
- Apply the lemma with and . The fixed-point equation holds if and only if .
- That is, , by the sum rule.
- For a convex function, is exactly the condition for a global minimum.
The step does not change the fixed points; it changes only how fast you reach them. For the lasso, step 1 reads coordinate by coordinate:
- if : ;
- if : .
These are the lasso KKT conditions. A feature stays at 0 as long as its correlation with the residual is at most .
ISTA and FISTA for the lasso #
Let , so and . Here is the lasso penalty and is an eigenvalue. Use the step , and write , .
- ISTA (iterative shrinkage-thresholding):
- FISTA (Beck and Teboulle, 2009): start with , ; for ,
The point is a Nesterov extrapolation (lesson 04). The cost per step is the same as for ISTA: one product with and one with .
Theorem (rates; Beck and Teboulle 2009, theorems 3.1 and 4.4). Let be convex and -smooth, closed and convex, the step , and any minimizer. Then
ISTA is monotone: . If is -strongly convex, ISTA also converges linearly: . FISTA is not monotone: the momentum can overshoot. The ISTA proof is the proof of lesson 03 with replaced by the gradient mapping ; the FISTA proof is Nesterov's (Vandenberghe's lectures below). The method still converges for steps , but the majorize–minimize argument and the bounds above need ; if is unknown, use backtracking.
The rates on a 2D example. Take , , . Then , so , and ; per coordinate, . From :
- ISTA first reaches at .
- FISTA first reaches it at , but then oscillates; it stays below only from .
- FISTA with a function-value restart (when a step would raise , set and redo the step from the previous point; O'Donoghue and Candès 2015) stays below from .
Both methods converge linearly here because the problem is strongly convex. The general bounds above ignore and promise only (ISTA) and (FISTA). They are the right guarantee when , for example a lasso with more features than samples.
Drag the start point, move , and press Play. ISTA (blue) and FISTA (violet) minimize a 2D lasso whose contours (grey) have kinks on the axes. At the minimizer is : both methods reach exactly after a finite number of steps. FISTA overshoots past and its curve in the chart goes up and down, but it ends far ahead of ISTA. The dashed lines are the two worst-case bounds. The worked example has ; there acceleration helps little.
You run FISTA on a lasso and see . What is the most likely explanation?
FISTA guarantees the bound , not a decrease at every step. On the worked example of section 4 it goes from to above between and . ISTA with is monotone. If the increases bother you, use a restart.
The lasso path #
How does control sparsity? At the optimality condition of the lasso reads . So for the solution is exactly 0 (lesson 08, check yourself 6). As decreases, features enter the model one by one, and sometimes one leaves again. The curve is the lasso path; it is piecewise linear in . Solvers compute it from large to small , starting each fit at the previous solution (warm start).
Move and watch which coefficients are exactly 0. The curves (colours 1, 2, 3, 4, 5) are the lasso coefficients of a small data set (20 samples, 5 standardized features), computed in your browser by coordinate descent. Right of all are 0. Coefficient 3 enters first, grows, shrinks, is exactly 0 again for between about and , and then turns negative: a coefficient can leave the model when correlated features take over.
ADMM: split the problem into easy pieces #
ADMM (the alternating direction method of multipliers) solves
Make a copy of , give to and to , and force them to agree. The augmented Lagrangian is the Lagrangian of lesson 08 plus a quadratic penalty :
ADMM minimizes over , then over , then takes a gradient ascent step on the multiplier . With the scaled dual variable , the three updates are
The vector is the running sum of the disagreements : it keeps pushing and together.
ADMM for the lasso (Boyd et al. §6.4). With and :
- The -update is a ridge regression with a fixed matrix. Factor once (Cholesky); then each iteration costs two triangular solves.
- The -update is the soft threshold, so is exactly sparse; is only close to sparse.
- Stop when the primal residual and the dual residual are both small (Boyd et al. §3.3).
Convergence (Boyd et al. §3.2). If and are closed, proper and convex, and the (unaugmented) Lagrangian has a saddle point, then for every : , , and . In practice ADMM reaches modest accuracy in a few tens of iterations, but it can be slow to reach high accuracy, and changes the speed (not the solution).
When splitting is the better tool.
- The prox of each piece is easy, but the prox of their sum is not: (total variation, the generalized lasso; split ), or a penalty plus constraints.
- The data are spread over machines: consensus ADMM fits local models and combines them in the -step (Boyd et al. §7–8).
- The -update is cheap to repeat (a cached factorization, an FFT), while gradient steps would be slow because is large.
When has a cheap prox and is smooth, FISTA is simpler and has no to tune. When you need high accuracy, use a Newton-type or interior-point method.
Plug-and-play priors
In the -update, is a denoising problem: find a close to the noisy that the prior likes. Plug-and-play ADMM (Venkatakrishnan, Bouman and Wohlberg, 2013) replaces this step by any good denoiser, for example a trained neural network, without ever writing down. DiffPIR (Zhu et al., 2023) uses a diffusion model as the denoiser, inside a related splitting method. This is one way to put a learned prior, such as a diffusion model of seismic or climate fields, into a physical inverse problem.
In ADMM for the lasso, which update produces exact zeros?
The -update is the prox of with step : soft thresholding at , which sets small entries to exactly 0. The -update is a ridge regression, which shrinks but never gives exact zeros. So return , not , as the sparse solution.
Answers to section 1. (1) exactly, because (). The subgradient method with decreasing steps moves around 0 and comes closer, but in general it never lands exactly on 0. The prox gets there in one step. (2) No. The momentum can overshoot, so can go up (section 4 shows it). Only the bound decreases.
4. Worked example #
, , : the lasso of lesson 08, section 4(c). Here (eigenvalues 1 and 3) and . So , , the step is and the threshold is . At the start, .
ISTA by hand. .
- : . Gradient step: . Threshold by : , because .
- : . Gradient step: . Threshold: .
The second coordinate stays 0, because . On the line the update is , so and .
Optimality check (theorem above). .
- Coordinate 1 is nonzero, and ✓.
- Coordinate 2 is zero, and ✓.
The optimal value is .
The rate on this example. On the line , , so (, , …). This is far below the bound , and even faster than the strongly convex factor . The reason: the zero pattern is found at step 1, and then ISTA is gradient descent on the support alone, with curvature and factor per step.
FISTA by hand. as for ISTA. Then and , so and . Next and the momentum factor is , so and , closer than ISTA's . But the momentum keeps growing: overshoots, and goes up between and ( above ). With , ISTA is even ahead at ( against ). Acceleration helps when is large.
ADMM by hand (). Start from . The matrix is , with inverse .
- .
- : exactly sparse, while is not.
- .
The iterates converge to and . At a fixed point, and : the scaled dual variable is the subgradient that certifies optimality.
5. In code #
NumPy checks the hand results; scikit-learn solves the same lasso by coordinate descent. The notebook asks you to write these methods yourself.
import numpy as np
from scipy.optimize import minimize_scalar
from sklearn.linear_model import Lasso
def soft(v, t): # prox of t*|.|: soft thresholding
return np.sign(v) * np.maximum(np.abs(v) - t, 0)
# (a) soft thresholding, and a brute-force check of one entry
v = np.array([2.5, -0.3, 0.8, -1.5])
print(soft(v, 1.0) + 0.0) # [ 1.5 0. 0. -0.5]
print(round(minimize_scalar(lambda u: abs(u) + 0.5 * (u - 2.5) ** 2).x, 6)) # 1.5
# (b) the worked example: ISTA with step 1/L
A = np.array([[1.0, 1.0], [1.0, 0.0], [0.0, 1.0]])
b = np.array([1.0, 2.0, -0.5])
lam = 1.0
L = np.linalg.norm(A, 2) ** 2 # 3.0
F = lambda x: 0.5 * np.sum((A @ x - b) ** 2) + lam * np.sum(np.abs(x))
x = np.zeros(2)
for k in range(3):
x = soft(x - A.T @ (A @ x - b) / L, lam / L)
print(k + 1, x.round(4) + 0.0) # 1 [0.6667 0.] 2 [0.8889 0.] 3 [0.963 0.]
# FISTA: the gap F(x_k) - F* for k = 6..9 goes up between k = 7 and k = 8
x, y, t, gaps = np.zeros(2), np.zeros(2), 1.0, []
for k in range(10):
x_old, x = x, soft(y - A.T @ (A @ y - b) / L, lam / L)
t_new = (1 + np.sqrt(1 + 4 * t * t)) / 2
y, t = x + (t - 1) / t_new * (x - x_old), t_new
gaps.append(F(x) - 1.625)
print(np.array(gaps[5:9])) # [4.53e-06 1.37e-07 4.85e-07 9.62e-08]
# (c) scikit-learn minimizes F/m with alpha = lam/m
m = A.shape[0]
x_star = Lasso(alpha=lam / m, fit_intercept=False, tol=1e-12, max_iter=100_000).fit(A, b).coef_
print(x_star.round(8) + 0.0, F(x_star)) # [1. 0.] 1.625
# (d) x* is a fixed point of the proximal gradient map for every step
grad = A.T @ (A @ x_star - b)
print(grad.round(8) + 0.0) # [-1. 0.5]
for a in [1 / 3, 0.1, 1.0]:
print(soft(x_star - a * grad, a * lam).round(8) + 0.0) # [1. 0.] each time
# (e) ADMM with rho = 1
rho = 1.0
M = np.linalg.inv(A.T @ A + rho * np.eye(2)) # tiny here; in practice factor once (Cholesky)
x = z = u = np.zeros(2)
for k in range(100):
x = M @ (A.T @ b + rho * (z - u))
z = soft(x + u, lam / rho)
u = u + x - z
print(z.round(6) + 0.0, u.round(6) + 0.0) # [1. 0.] [ 1. -0.5]
6. Where it shows up #
- Sparse models and inverse problems. Daubechies, Defrise and De Mol (2004) proved that iterative soft thresholding converges for linear inverse problems with a sparsity penalty. and total-variation penalties are standard in compressed sensing, MRI reconstruction, imaging and geophysical inversion.
- Constraints in training.
p.data.clamp_(lo, hi)after each SGD step is projected (stochastic) gradient descent on a box: physical bounds on parameters, nonnegative factors, weight clipping in the original Wasserstein GAN. - Weight decay as a prox. The prox of is , and decoupled weight decay is its first-order version. AdamW can be read as an approximate proximal method (Zhuang et al., 2022; lesson 06).
- Unrolled and learned algorithms. LISTA (Gregor and LeCun, 2010) unrolls a few ISTA steps into a network and learns the matrices and thresholds. Plug-and-play ADMM and diffusion-based solvers put a learned denoiser in place of the prox (see the folded block above).
- Distributed fitting. Consensus ADMM fits one model on data split over many machines; each machine solves its own small problem, and the -step averages.
- Sparse inverse covariance. The graphical lasso estimates a sparse precision matrix with an penalty; ADMM is one standard solver (Boyd et al. §6.5).
7. Common mistakes #
- Thresholding at instead of step × . ISTA thresholds at for the step ; ADMM thresholds at .
- Using scikit-learn's
alphaas . scikit-learn divides the data term by the number of rows : it minimizes , so . - Expecting FISTA to be monotone. It is not. Plot on a log scale, and restart if needed.
- Refactoring in every ADMM iteration. does not change; factor it once. If you change during the run, refactor and rescale .
- Returning ADMM's . is exactly sparse; is only close to sparse.
- A step above without a line search. The bounds need . If is unknown, use backtracking.
8. Check yourself #
- What is the prox of the indicator of the nonnegative orthant ?
Answer
The projection onto the orthant, entry by entry: the ReLU. - Compute for and .
Answer
. The first entry has , so it becomes exactly 0; the others move toward 0 by 0.5. - Show that the prox of with step is . Can it give exact zeros?
Answer
The objective is smooth with gradient . Setting it to 0 gives , so . It shrinks every entry by the same factor, so an entry is 0 only if it was 0 in . - For over a closed convex set , what does mean geometrically?
Answer
A projection satisfies for all . With and , this gives for all : no feasible direction decreases to first order. Equivalently, points out of (it lies in the normal cone of at ). In the interior of it means . - , , and you want . After how many iterations do the ISTA and FISTA bounds guarantee it?
Answer
ISTA: gives . FISTA: gives , so . - In ADMM for the lasso, what changes when you increase ?
Answer
The threshold gets smaller, and the -update is pulled harder toward . The primal residual tends to get smaller and the dual residual larger. The solution does not change, only the speed. You must refactor , and rescale if changes during the run.
Define the proximal operator .
: the point that balances a small against staying close to .
Give the soft-thresholding formula, the prox of .
; every goes to exactly 0.
Compute for .
, because : the point is in the dead zone.
What is the prox of the indicator of a closed convex set ?
The Euclidean projection , for every step .
Write the proximal gradient update for .
: a gradient step on , then a prox step on .
What is the subdifferential of at ?
The interval : every slope between and gives a supporting line.
How are the minimizers of related to the proximal gradient map?
They are exactly its fixed points: for any .
State the rates of ISTA and FISTA with step .
ISTA: . FISTA: .
Why is FISTA not monotone?
Its Nesterov momentum can overshoot the minimizer, so can go up; only the bound decreases.
Name the three ADMM updates for the lasso.
: a ridge-type solve with ; : soft threshold ; : .
9. Interview angle #
- "Why does give exact zeros and does not?" — The prox of maps the whole interval to 0; the prox of only scales. Geometrically, the ball has corners on the axes.
- "What is a proximal operator?" — . A projection is the case of an indicator function.
- "How would you solve a lasso with features?" — Coordinate descent (scikit-learn, glmnet) or FISTA, with a duality-gap stop; ADMM if the data are distributed or the penalty is .
- "Why is FISTA faster, and what does it cost?" — Nesterov momentum: instead of at the same cost per step, but it is not monotone.
- "You need in PyTorch. Simplest correct method?" — Projected gradient: clamp after each step.
- "What does do in ADMM?" — It weights the agreement penalty. It changes the speed and the balance of primal and dual residuals, not the solution.
10. Practice #
The notebook for this lesson runs in Colab. Each exercise has a check cell and a folded solution.
- Soft thresholding and the prox of ; check them against brute-force 1D minimization.
- Projected gradient onto a box for bound-constrained least squares; compare with
scipy.optimize.lsq_linear. - ISTA and FISTA for the lasso on the diabetes data; compare with scikit-learn's
Lasso(mind the scaling), and plot on a log scale. - ADMM for the lasso with one Cholesky factorization, stopping on the primal and dual residuals.
- Check the lasso optimality (subgradient) conditions of a solution, coordinate by coordinate.
11. Watch and read #
- Parikh and Boyd, Proximal Algorithms, free: §2.3 (fixed points), §4.2 (proximal gradient), §4.3 (acceleration), §4.4 (ADMM), §6.5.2 (prox of the norm).
- Boyd, Parikh, Chu, Peleato and Eckstein, Distributed Optimization and Statistical Learning via ADMM, free: §3.1–3.3 (algorithm, convergence, stopping rules), §6.4 (lasso), §7–8 (consensus).
- Vandenberghe, UCLA ECE236C, Proximal gradient method (the proof) and Accelerated proximal gradient methods (FISTA and the bound).
- Ryan Tibshirani, CMU 10-725, lecture notes on proximal gradient descent and ADMM.
- Beck and Teboulle, "A fast iterative shrinkage-thresholding algorithm for linear inverse problems", SIAM Journal on Imaging Sciences 2(1), 2009 (the FISTA paper and its rates).
Runs in your browser with nothing to install. The notebook repeats the key demos and has exercises with checks; solutions are inside, folded.
No Google account needed: Python runs inside your browser. The first start downloads about 40 MB; your changes are saved in this browser only.