The learning rule is a subgradient step
symbolic▲▲△Symbolic throughout.
STATEMENT
The perceptron rule looks like a hand-made heuristic. Show that it is exactly one step of subgradient descent, with learning rate , on a specific loss — and identify that loss.
GIVEN
The perceptron loss for one example, sometimes called the hinge-at-zero loss:
and the update rule of Definition 7: on a mistake, and .
FIND
The subgradient of with respect to and in both regimes, and the resulting descent step at .
STRATEGY
Split on the sign of the margin, differentiate each branch, and compare the resulting step with the rule. The function is not differentiable at the join, which is why “subgradient” rather than “gradient” — and that is a feature worth naming rather than glossing.
SOLUTION
Step 1 — name the inner quantity. Let be the functional margin, so .
Step 2 — the case (correct). Then , the maximum is achieved by the constant , and is identically zero in a neighbourhood. A locally constant function has zero derivative:
The descent step changes nothing. This matches the rule’s “otherwise do nothing” exactly.
Step 3 — the case (wrong). Then , which is affine in the parameters and so differentiable. Using (The derivative of a linear map 0.MC.04):
Step 4 — take a descent step. Gradient descent moves against the gradient (Gradient descent 0.OP.02), with :
These are the update rule, term for term.
Step 5 — the join at . At exactly zero the function has a kink and no derivative exists. The subdifferential is the whole interval between the two one-sided slopes, . Any element is a legal subgradient step; the perceptron picks , which is why it updates on rather than . That convention, which looked arbitrary in I.2.B02, is a choice of subgradient.
Answer
The perceptron rule is subgradient descent on with , taking the subgradient at the kink:
Check — sanity
The loss is zero exactly when the rule is idle. no update. The two descriptions of “nothing to do here” agree, which they must if one is to be a restatement of the other.
The loss is convex. It is the maximum of two affine functions of the parameters, and a pointwise maximum of convex functions is convex (Convexity 0.OP.01). So the perceptron is minimising a convex objective — and yet it still fails to terminate on XOR, because the minimum of that objective is not zero there. Convexity buys a well-posed problem, not a useful answer.
The learning rate is genuinely irrelevant here. Any gives , which rescales but not the sign of any score when starting from — so the sequence of predictions is identical. This is unique to the perceptron and stops being true the moment Chapter I.4 introduces a loss with curvature.
Where this breaks
The identification needs and for the sequence to match; only the form of the step matches for general . It also needs the loss to be this one. The very similar hinge loss — which demands a margin of at least rather than merely a correct sign — gives the same-shaped update but a different idle region, and converges to a maximum-margin solution the perceptron never finds. One symbol’s difference in the loss changes what the algorithm is for.
Variation
Derive the update for the hinge loss and state, in one sentence, what the extra changes about which hyperplanes are stationary points.