The perceptron mistake bound #
The perceptron [Nov62] [Blo62] [ShalevShwartzBenDavid2014, §21.4] is an online
learner on a real inner product space E. It keeps a weight vector w, starting at 0, predicts
true on x iff 0 < ⟪w, x⟫, and on a mistake on the example (x, y) updates
w ← w + s(y) • x, where s(y) = ±1 is the signed label (signedLabel). The weight vector is a
function of the history (perceptronWeight), so the perceptron is an OnlineLearner E Bool.
Novikoff's theorem. Suppose that some u : E separates the sequence with margin γ ≥ 0, that
is, γ ≤ s(y) ⟪u, x⟫ for every example, and that every instance has norm at most R. Then the
number M of mistakes satisfies M γ² ≤ R² ‖u‖² (mistakes_perceptron_mul_sq_le). For a unit
separator and γ > 0, this is M ≤ (R / γ)² (mistakes_perceptron_le), independent of the length
of the sequence and of the dimension of E. The proof tracks two quantities over the mistakes:
⟪u, w⟫ grows by at least γ per mistake, while ‖w‖² grows by at most R² because the
prediction was wrong; Cauchy–Schwarz combines them.
The hypothesis 0 ≤ γ is needed: with u = 0 and γ < 0 the margin condition holds for every
sequence, while the bound M γ² ≤ 0 fails as soon as the perceptron errs. A positive margin makes
the sequence realizable by the halfspace x ↦ decide (0 < ⟪u, x⟫) (realizable_of_margin). The
bound is stated per sequence: the margin is a property of the instances presented, not only of the
target concept.
Main definitions #
Cslib.MachineLearning.OnlineLearning.MistakeBound.signedLabel: the±1encoding of labels.Cslib.MachineLearning.OnlineLearning.MistakeBound.perceptronWeight: the weight vector after a history.Cslib.MachineLearning.OnlineLearning.MistakeBound.perceptron: the perceptron as an online learner.
Main results #
Cslib.MachineLearning.OnlineLearning.MistakeBound.mistakes_perceptron_mul_sq_le: Novikoff's boundM γ² ≤ R² ‖u‖².Cslib.MachineLearning.OnlineLearning.MistakeBound.mistakes_perceptron_le:M ≤ (R / γ)²for a unit separator.Cslib.MachineLearning.OnlineLearning.MistakeBound.realizable_of_margin: a positive margin makes the sequence realizable by a halfspace.
References #
The ±1 encoding of a Boolean label: true ↦ 1, false ↦ -1.
One step of the perceptron on the example p = (x, y): keep w if its prediction
0 < ⟪w, x⟫ is correct, and otherwise add s(y) • x.
The perceptron's weight vector after the history h, starting from 0.
The perceptron [Nov62] [ShalevShwartzBenDavid2014, §21.4]: predict true on x iff
0 < ⟪w, x⟫ for the current weight vector w.
The two invariants of the perceptron after the history h, over the rounds S: each mistake
increases ⟪u, w⟫ by at least γ and ‖w‖² by at most R².
Novikoff's perceptron convergence theorem [Nov62] [Blo62]
[ShalevShwartzBenDavid2014, §21.4]: if u separates the sequence S with margin γ ≥ 0 and all
instances have norm at most R, then the perceptron makes M mistakes on S with
M γ² ≤ R² ‖u‖².
The perceptron bound for a separator of norm at most 1 and margin γ > 0: at most
(R / γ)² mistakes [ShalevShwartzBenDavid2014, §21.4].
A sequence separated by u with a positive margin is realizable by the halfspace
x ↦ decide (0 < ⟪u, x⟫).