A two-party learner whose symbols may serve later vectors #
The two-party model of ReflectiveSubsystems/LaggedTwoParty.lean has an outside party that sees
every vector of the candidates' predictions but learns each outcome L steps late, and an inside
party that sees only the outside's symbols, one per step, and the outcomes, and predicts.
Here the inside party may wait for the symbols of the next Δ steps before it predicts step t:
it predicts step t from the symbols at steps 0 … t + Δ and the outcomes before t, so a symbol
may serve a vector up to Δ steps before it.
At Δ = 0 this is the model of ReflectiveSubsystems/LaggedTwoParty.lean.
Main results #
SlackTwoPartyLearner— the two-party model with a slackΔ, withSlackTwoPartyLearner.message,SlackTwoPartyLearner.predictionandSlackTwoPartyLearner.missCountas in the model without slack; a stream is realizable in the sense ofLaggedTwoPartyLearner.Realizable.LaggedTwoPartyLearner.toSlack— the model without slack as the caseΔ = 0.LaggedTwoPartyLearner.missCount_toSlack— the miss counts of a learner without slack and of its image agree.interleavedHalving— interleaved halving: for each residue of the steps moduloL - Δ, one halving learner (Littlestone's halving algorithm) on that residue's steps; at stepτ ≥ Δthe outside sends the majority vote, at the vector of stepτ - Δ, of the candidates agreeing with every known outcome of that step's residue, and the inside predicts the bit sent att + Δ.missCount_interleavedHalving_le— its bound: atΔ < L, on every realizable stream and at every horizon, the count is at most(L - Δ) * Nat.log 2 (Fintype.card H).missCount_interleavedHalving_le_nonvacuous— the hypotheses hold atΔ = 0,L = 1and two candidates.missCount_interleavedHalving_attained— the bound is attained at that instance: on a stream where one of two candidates is right, the count to horizon one is the bound.
The method #
A candidate is consistent with a residue's known outcomes when it agrees with each of them.
The outcome of step s is known to the outside by step τ when s ≤ τ - L, and the earlier steps
s < t of the residue of t = τ - Δ all satisfy s ≤ t - (L - Δ) = τ - L, so at step τ the
outside knows every earlier outcome of the residue of t: on that residue the learner is the
halving learner.
A miss at a step of a residue leaves at most half of that residue's consistent candidates, and a
candidate that realizes the stream always stays, so a residue misses at most the logarithm of the
number of candidates, and the L - Δ residues add.
A two-party learner whose symbols may serve later vectors. The outside party sees the
vectors of the candidates' predictions at once but learns the outcome of step s only at step
s + L; the inside party sees only the outside's symbols and the outcomes, and predicts step t
after the symbol of step t + Δ. At Δ = 0 this is LaggedTwoPartyLearner.
The outside's symbol at step
t, from the vectors at steps0 … tand the outcomes at steps0 … t - L(none whilet < L).The inside's prediction at step
t, from the symbols at steps0 … t + Δand the outcomes at steps0 … t - 1.
Instances For
The symbol at a step. What the outside sends at step t on the stream (v, y): its
function speak of the vectors up to t and the outcomes up to the lag.
Equations
Instances For
The prediction at a step. What the inside predicts at step t on the stream (v, y): its
function predict of the symbols up to t + Δ and the outcomes before t.
Equations
Instances For
The count. The number of steps t < n at which the inside's prediction differs from the
outcome.
Equations
- A.missCount v y n = {t ∈ Finset.range n | A.prediction v y t ≠ y t}.card
Instances For
The model without slack as the case of no slack.
Instances For
The miss count of a learner without slack is that of its image in the model with slack.
The majority vote, at the vector u t, of the consistent candidates: true exactly when more
of them vote true than false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Interleaved halving. One halving learner for the steps of each residue modulo L - Δ:
at step τ ≥ Δ the outside sends the majority vote, at the vector of step τ - Δ, of the
candidates agreeing with every known outcome of that step's residue; the inside predicts the bit
sent at t + Δ. At a step τ < Δ the outside sends false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bound of interleaved halving. At a slack below the lag, on every realizable stream and
at every horizon, interleaved halving misses at most Nat.log 2 of the number of candidates times
L - Δ: its L - Δ residues are each a halving learner, whose misses each leave at most half of
the consistent candidates.
The hypotheses of the bound hold jointly. At no slack, a lag of one step and two candidates, one of which is right at every step.
The bound is attained. At no slack, a lag of one step and two candidates, the second right
at every step, interleaved halving misses at the first step, where the votes tie and the tie goes
to false: its count to horizon one is (1 - 0) * Nat.log 2 2.