Gaussian elimination as an online learner of the parities #
The parities on the cube Fin n → Bool are the codewords of the Hadamard code
(Cslib.BitString.hadamardCode): the parity of y labels the point a by the dot product
y ⬝ᵥ a in the Boolean ring. The elimination learner keeps n rows, each a point of the cube
with a bit, a row (0, false) being empty. It predicts at a the label of the first parity, in
the order of binaryEquiv, that satisfies every row, and false when none does. At a miss at
a with outcome b it writes (a, b) into the first empty row, when there is one, and at a hit
it stays. Its state after a history is the rows folded from the history by this rule
(ParityElimination.state), and it is an OnlineLearner of the realizable mistake-bound model
of Cslib.MachineLearning.OnlineLearning.MistakeBound.
Main definitions #
ParityElimination.learner— the elimination learner.
Main results #
ParityElimination.mistakeBound_learner_le— the elimination learner makes at mostnmistakes on every sequence a parity ofnbits realizes: a miss fills a row and halves the set of parities that satisfy the rows, and a set that has halvedntimes is the target alone. This is the mistake bound of the elimination algorithm for the parities of Blum (1998, "On-line algorithms in machine learning", §4).
The order of the parities. The 2 ^ n points of the cube as the first 2 ^ n numbers, a
point read as a number written in binary; the learner takes the first parity in this order that
satisfies the rows.
Equations
Instances For
The transition. At a miss at the point a with outcome b, the pair (a, b) goes into
the first empty row, nothing when none is empty; at a hit the rows stay.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The rows after a history: the rows folded from the history by step, from the empty
rows.
Equations
- ParityElimination.state h = List.foldl (fun (s : ParityElimination.Rows n) (p : (Fin n → Bool) × Bool) => ParityElimination.step s p.1 p.2) (fun (x : Fin n) => ParityElimination.emptyRow n) h
Instances For
The elimination learner. After the history h it predicts at a with the rows
state h.
Equations
Instances For
Halving #
The elimination learner makes at most n mistakes on the parities: on every sequence
that a parity of n bits realizes, in the realizable mistake-bound model, whatever its length.
Each miss fills a row and halves the set of parities that satisfy the rows, and a set that has
halved n times is the target alone. This is the mistake bound of Blum (1998, "On-line algorithms
in machine learning", §4) for the parities.