Subgradients
A convex subgradient defines a global linear lower bound; absolute value has every slope in [−1,1] at zero.
On this page 8 sections
- Overview
- Understand the idea
- For |x|, the slope is −1 when x<0 and +1 when x>0
- Checking z=0 alone cannot reject any proposed slope at the origin: both sides equal zero
- This supporting-line view explains how optimization can work with a nonsmooth L1 penalty
- Key takeaway
- Sources & further reading
- Concept connections
01Understand the idea#
Ordinary derivatives require one local slope, but penalties such as absolute value have a corner at zero. Convex subgradients extend slope information to that case. A valid subgradient gives a line touching the function at the current point and staying below it everywhere.
A convex subgradient gives a supporting line below the function. At x, slope g must satisfy this for every z:
At a smooth point it is the derivative. At a kink there can be an interval of valid slopes.
For |x| at zero, slopes from −1 through 1 all work. Slope 0.25 is valid; slope 3 fails at z=1 because 1<3.
At zero, has right slope 1 and left slope . A line stays below for every exactly when . If , try : the line gives 3 above the function’s 1, so that proposed slope fails.
f(x)=|x|. At x=0, which slope is a valid subgradient?
Show answer and explanation
At zero use [−1,1]; away from zero use the sign of x.
02For |x|, the slope is −1 when x<0 and +1 when x>0#
For |x|, the slope is −1 when x<0 and +1 when x>0. At zero the full set is [−1,1].
For a|x−c| with a>0, the kink moves to c and its slope interval becomes [−a,a].
f(x)=5|x−2|. Give the full subdifferential at x=2.
Show answer and explanation
The kink is at 2; scale both slope endpoints by 5.
03Checking z=0 alone cannot reject any proposed slope at the origin: both sides equal zero#
Checking z=0 alone cannot reject any proposed slope at the origin: both sides equal zero. Use a point that can violate the global supporting-line condition.
A slope inside [−1,1] needs no repair for |x| at zero. Nondifferentiability does not mean there is no useful first-order information.
At x=0 for |x|, draft slope g=1.5. Which test disproves |z|≥gz for all z?
Show answer and explanation
At z=1, 1<1.5.
04This supporting-line view explains how optimization can work with a nonsmooth L1 penalty#
This supporting-line view explains how optimization can work with a nonsmooth L1 penalty. A single point on the line does not certify it; the condition must hold everywhere. At a smooth point of a convex function, the ordinary derivative supplies its subgradient.
Use the sign away from zero and the full allowed interval at zero; test a claimed slope with the supporting-line inequality.
- Identify valid subgradients of absolute value, including at zero.
Sources & further reading
- [1]Boyd, Duchi, Pilanci & Vandenberghe, Subgradients §1 ↗Boyd, Duchi, Pilanci & Vandenberghe, Subgradients §1 · Article