Exp4 analysis processes
Definitionexp4Analysisbandit-algorithmsonline-learning
For Exp4 with exploration parameter , let be the exponential weight of expert , let be the induced arm distribution, and let be the selected arm and observed reward.
The one-round score propagated to expert is
The analysis records the cumulative mixture score and cumulative quadratic mass
These are the two process-level quantities occurring in the Exp4 potential inequality and its second-moment estimate, so they can be reused in regret analyses before expectation and optimization of the learning rate.
Formalization Note exp4RewardIncrement, exp4MixtureEstimate, and exp4QuadraticMass define the displayed quantities recursively on finite bandit histories.
Definition code
import Definitions.Def_exp4Policy
open MeasureTheory ProbabilityTheory
namespace BanditAlgorithm
/-!
Analysis quantities from Lattimore--Szepesvári, *Bandit Algorithms*,
Algorithm 11 and the proof of Theorem 18.1, printed pp. 229--230.
-/
/-- The one-round reward estimate propagated by Exp4 from the selected arm to
expert `m` (Algorithm 11, lines 7--8). -/
noncomputable def exp4RewardIncrement {k M : ℕ} (η : ℝ)
(E : ℕ → Fin M → Fin k → ℝ) (r : ℕ)
(h : BanditHistory k r) (m : Fin M) (z : Fin k × ℝ) : ℝ :=
∑ a, E r m a *
(1 - if z.1 = a then
(1 - z.2) / exp4Prob η 0 E r h a
else 0)
/-- The cumulative Exp4 mixture score
`∑ₜ ∑ₘ Qₜₘ X̃ₜₘ` in Eqs. (18.9)--(18.11). -/
noncomputable def exp4MixtureEstimate {k M : ℕ} (η : ℝ)
(E : ℕ → Fin M → Fin k → ℝ) :
(n : ℕ) → BanditHistory k n → ℝ
| 0, _ => 0
| r + 1, h =>
exp4MixtureEstimate η E r (Fin.init h) +
∑ m, exp4ExpertWeights η 0 E r (Fin.init h) m *
exp4RewardIncrement η E r (Fin.init h) m (h (Fin.last r))
/-- The cumulative quadratic term
`∑ₜ ∑ₘ Qₜₘ (1-X̃ₜₘ)²` in Eqs. (18.9)--(18.12). -/
noncomputable def exp4QuadraticMass {k M : ℕ} (η : ℝ)
(E : ℕ → Fin M → Fin k → ℝ) :
(n : ℕ) → BanditHistory k n → ℝ
| 0, _ => 0
| r + 1, h =>
exp4QuadraticMass η E r (Fin.init h) +
∑ m, exp4ExpertWeights η 0 E r (Fin.init h) m *
(1 - exp4RewardIncrement η E r (Fin.init h) m
(h (Fin.last r))) ^ 2
end BanditAlgorithmSource
Lattimore and Szepesvári, Bandit Algorithms (Cambridge University Press, 2020), Algorithm 11, printed p. 229, lines 7–9, and Theorem 18.1 proof, printed p. 230, Eqs. (18.9)–(18.12). https://tor-lattimore.com/downloads/book/book.pdf