Documentation

CslibFrontier.MachineLearning.OnlineLearning.RandomizedWeightedMajority

Generalized Randomized Weighted Majority on [0, 1] losses #

This module formalizes the [0, 1]-loss generalization of Randomized Weighted Majority (RWM) with multiplicative update rule w_i^{t+1} = w_i^t * (1 - η) ^ (ℓ_i^t) (rwmFactor), from [BlumMansour2007AGT, §4.3.2, p. 85, and Exercise 4.3, p. 101].

Summary of results #

Main definitions #

Main results #

References #

Update factor (1 - η) ^ x and structural identities #

The [0, 1]-loss Randomized Weighted Majority update factor (1 - η) ^ x [BlumMansour2007AGT, §4.3.2, p. 85, and Exercise 4.3, p. 101].

On binary {0, 1} losses, rwmFactor coincides with Polynomial Weights mwFactor.

For η < 1, rwmFactor η equals hedgeFactor (-log (1 - η)).

Convexity (Bernoulli) bound: (1 - η) ^ x ≤ 1 - η * x for η < 1 and x ∈ [0, 1].

For η < 1, generalized Randomized Weighted Majority is a causal online algorithm.

[0, 1]-loss regret bounds for generalized RWM (Exercise 4.3) #

theorem Cslib.MachineLearning.OnlineLearning.Experts.rwm_regret_le {ι : Type u_1} [Fintype ι] {ℓ : ℕ → ι → ℝ} {T : ℕ} {η : ℝ} (hη : 0 < η) (hη' : η ≤ 1 / 2) (hℓ : ∀ s < T, ∀ (i : ι), ℓ s i ∈ Set.Icc 0 1) (i : ι) :
∑ t ∈ Finset.range T, ∑ j : ι, prob (rwmFactor η) ℓ t j * ℓ t j ≤ (1 + η) * ∑ t ∈ Finset.range T, ℓ t i + Real.log ↑(Fintype.card ι) / η

First-order regret of generalized RWM on [0, 1] losses [BlumMansour2007AGT, §4.3.2, p. 85, and Exercise 4.3, p. 101]: for 0 < η ≤ 1 / 2, losses in [0, 1], and every expert i, ∑ t, ⟨p t, ℓ t⟩ ≤ (1 + η) * ∑ t, ℓ t i + ln n / η.

theorem Cslib.MachineLearning.OnlineLearning.Experts.rwm_regret_le_sqrt_of_mem_Icc {ι : Type u_1} [Fintype ι] {ℓ : ℕ → ι → ℝ} {T : ℕ} (hℓ : ∀ s < T, ∀ (i : ι), ℓ s i ∈ Set.Icc 0 1) (i : ι) :
∑ t ∈ Finset.range T, ∑ j : ι, prob (rwmFactor (min (√(Real.log ↑(Fintype.card ι) / ↑T)) (1 / 2))) ℓ t j * ℓ t j ≤ ∑ t ∈ Finset.range T, ℓ t i + 2 * √(↑T * Real.log ↑(Fintype.card ι))

Tuned 2 √(T ln n) external regret of generalized RWM on [0, 1] losses for every horizon [BlumMansour2007AGT, Exercise 4.3, p. 101]: with the capped learning rate η = min √(ln n / T) (1 / 2), generalized RWM achieves L_RWM^T ≤ L_i^T + 2 √(T ln n) for every T : ℕ, matching the external regret bound of Theorem 4.6 for Polynomial Weights.

theorem Cslib.MachineLearning.OnlineLearning.Experts.rwm_regret_le_sq_learner {ι : Type u_1} [Fintype ι] {ℓ : ℕ → ι → ℝ} {T : ℕ} {η : ℝ} (hη0 : 0 < η) (hη1 : η < 1) (hℓ : ∀ s < T, ∀ (i : ι), 0 ≤ ℓ s i) (i : ι) :
∑ t ∈ Finset.range T, ∑ j : ι, prob (rwmFactor η) ℓ t j * ℓ t j ≤ ∑ t ∈ Finset.range T, ℓ t i + -Real.log (1 - η) / 2 * ∑ t ∈ Finset.range T, ∑ j : ι, prob (rwmFactor η) ℓ t j * ℓ t j ^ 2 + Real.log ↑(Fintype.card ι) / -Real.log (1 - η)

Learner-side second-order bound for generalized RWM: via rwmFactor_eq_hedgeFactor and hedge_regret_le_of_nonneg, for 0 < η < 1 and nonnegative losses, generalized RWM satisfies the Hedge variance bound with effective rate -log (1 - η).

Boundary refutation: generalized RWM fails Theorem 4.6's expert-side Q_k^T display #

theorem Cslib.MachineLearning.OnlineLearning.Experts.exists_rwm_gt_add_mul_sq_add_log (c : ℝ) :
∃ (T : ℕ) (ℓ : ℕ → Fin 2 → ℝ), (∀ t < T, ∀ (i : Fin 2), ℓ t i ∈ Set.Icc 0 1) ∧ ∑ t ∈ Finset.range T, ℓ t 0 + c * ∑ t ∈ Finset.range T, ℓ t 0 ^ 2 + Real.log ↑(Fintype.card (Fin 2)) / (1 / 2) < ∑ t ∈ Finset.range T, ∑ j : Fin 2, prob (rwmFactor (1 / 2)) ℓ t j * ℓ t j

Boundary refutation for Exercise 4.3: generalized RWM (rwmFactor (1 / 2)) does not satisfy the expert-side quadratic bound L_RWM^T ≤ L_k^T + η * Q_k^T + ln N / η of Theorem 4.6 on [0, 1] losses—in fact, for every real c (in particular c = 1 / 2), there exist a horizon T and [0, 1]-valued losses on Fin 2 whose RWM loss strictly exceeds L_0^T + c * Q_0^T + ln 2 / (1 / 2).