Why are the non-negative weighted sum (), the pointwise maximum , and the affine composition convex whenever each and is convex, and how do these rules show that the L2-regularised hinge loss is convex without computing any Hessian?
Linear algebra and optimisation, Convexity
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can prove the three workhorse rules that preserve convexity and apply them to a non-differentiable ML loss.
Key idea
Checking convexity directly from the chord inequality avoids needing derivatives, so these three rules let you prove convexity of non-smooth objectives like SVMs and L1-regularised models in two lines.
Steps
- Non-negative weighted sum: let with . For any in the common convex domain and , multiply each convex inequality by (preserving the direction) and sum over to get .
- Pointwise maximum: let . For each , . Taking on the left preserves the bound.
- Affine composition: let for a matrix and vector . Substitute and : .
- Apply to the L2-regularised SVM loss , where are training inputs and labels, is the weight vector, is the bias and is the regularisation weight: each is affine in (equivalently, is convex as the pointwise maximum of and , and composing it with the affine map preserves convexity). Adding (convex, weighted by ) gives a convex .
Common mistakes
- Allowing negative weights in the sum, or taking a pointwise minimum —neither preserves convexity in general.
- Trying to compute the Hessian of , which is not differentiable at .
How long your answer should be
Half a page; 4–5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Linear algebra and optimisation: Is it true that (a) a uniformly sampled mini-batch gradient is an unbiased estimator of the full-batch gradient, (b) every SGD step decreases the training objective, and (c) SGD with a fixed learning rate converges to the exact minimum, and why?
Next in Linear algebra and optimisation: What are the first-order and second-order conditions for a twice-differentiable function to be convex, and how do you prove that the second-order condition ( everywhere) implies the first-order condition ()?