The subgradient at the join
gradient▲▲△Using the perceptron loss of I.2.B07, compute the loss and a subgradient at three states: one with positive margin, one with negative margin, and one exactly at the kink. Then explain why the third case has a set of valid answers and which element the perceptron rule chooses.
Hint
At the kink, the two branches disagree about the slope. Every value between them is legitimate.
Solution
The three states. All with , and as given:
| Case | ||||
|---|---|---|---|---|
Case 1, . , and is identically zero nearby, so every derivative is zero. The rule is idle, and gradient descent agrees.
Case 2, . . On this branch , so and . The descent step is , which equals . The rule and the gradient step coincide.
Case 3, . , but the function is not differentiable here. Approaching from the slope is ; approaching from it is . The subdifferential is the whole segment joining them:
Every element is a valid subgradient, and each gives a different — equally legitimate — algorithm.
Which one the perceptron picks. , the most aggressive element. That is exactly what the condition “update when ” encodes: at the kink it behaves as though the example were wrong. Choosing instead would give “update only when ”, and starting from that algorithm never takes a first step at all, because the initial margin of every example is exactly zero.
Why this matters beyond the perceptron. ReLU has precisely this structure at the origin (Chapter I.3), and every framework silently chooses a subgradient there — usually , occasionally or . The choice is invisible in the loss curve and can change which units are dead. Knowing that a kink means a set rather than a value, and that someone has chosen for you, is worth carrying into every chapter that uses a piecewise-linear activation.