Section SA · Setup: model, momentum, regularized SignSVD, normalization · top-level result
Proved in Lean
Definition SA.2 (The algorithm)
Fix a momentum \(\bmom\in[0,1)\), a normalized ridge \(\ridge>0\), a deterministic step sequence \((\lr_t)_{t\ge0}\) with \(\lr_t\ge0\), an initial parameter \(W_0\) and an initial buffer \(M_{-1}^\circ\in\R^{\Nout\times\Nin}\), both given before the first batch is drawn (the default is \(M_{-1}^\circ=0\)). Let \(t_{\mathrm{stop}}\defeq\inf\{t\ge0:\cR(t)=0\}\in\{0,1,\dots\}\cup\{\infty\}\). The algorithm is, for \(t\ge0\),
\begin{equation}\tag{SA.15}
\begin{gathered}
M_t^\circ=\bmom\,M_{t-1}^\circ+(1-\bmom)\,\Gt^\circ,\qquad
W_{t+1}=\Wt-\lr_t\,\Gtilde^\circ,\\
\Gtilde^\circ\defeq\begin{cases}\Qridge{\ridgephys_t}(M_t^\circ),&t<t_{\mathrm{stop}},\\ 0,&t\ge t_{\mathrm{stop}},\end{cases}
\qquad \ridgephys_t\defeq2\cR(t)\,\ridge .
\end{gathered}
\end{equation}
Used by
- Corollary SA.1 Recursion of the algorithm
- Proposition SA.5 Support event and zero risk
- Theorem SE.1 Dynamical comparison
- Remark SE.1 Scope
- Corollary SF.1 Isotropic dynamics
Lean
Proved in Lean
Muon.Setup.def_app_setup_algorithm source
def def_app_setup_algorithm (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
(s₀ : AlgState m n) (x : ℕ → Batch m n B) : (ℕ → AlgState m n) × ℕ∞ :=Muon.Setup.AlgParams source
structure AlgParams (m n : ℕ) where
Muon.Setup.AlgState source
structure AlgState (m n : ℕ) where
Muon.Setup.initState source
def initState (W0 Mm1 : Mat m n) : AlgState m n := ⟨W0, Mm1⟩
Muon.Setup.errorOf source
def errorOf (p : AlgParams m n) (s : AlgState m n) : Mat m n := s.W - p.Wstar
Muon.Setup.stepBuffer source
def stepBuffer (p : AlgParams m n) {B : ℕ} (s : AlgState m n) (b : Batch m n B) : Mat m n :=Muon.Setup.stepUpdate source
def stepUpdate (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s : AlgState m n)
(b : Batch m n B) : Mat m n :=Muon.Setup.step source
def step (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (t : ℕ) (s : AlgState m n)
(b : Batch m n B) : AlgState m n :=Muon.Setup.run source
def run (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s₀ : AlgState m n)
(x : ℕ → Batch m n B) : ℕ → AlgState m n
| 0 => s₀
| t + 1 => step C p t (run C p s₀ x t) (x t)
/-- The stopping time `t_stop = inf {t : 𝓡(t) = 0}` of the trajectory, with values in `ℕ∞`
(`⊤` if the risk never vanishes). -/
def tstop (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s₀ : AlgState m n)
(x : ℕ → Batch m n B) : ℕ∞ :=Muon.Setup.tstop source
def tstop (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s₀ : AlgState m n)
(x : ℕ → Batch m n B) : ℕ∞ :=Muon.Setup.runRand source
def runRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
(s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) (ω : Ω) : AlgState m n :=Muon.Setup.devRand source
def devRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
(s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) : Ω → Mat m n :=Muon.Setup.gtRand source
def gtRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
(s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) : Ω → Mat m n :=Muon.Setup.tstopRand source
def tstopRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
(s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) : Ω → ℕ∞ :=Muon.Setup.stepUpdate_eq_paper source
theorem stepUpdate_eq_paper (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
(s₀ : AlgState m n) (x : ℕ → Batch m n B) (t : ℕ) :
stepUpdate C p (run C p s₀ x t) (x t)
= if (t : ℕ∞) < tstop C p s₀ x then
Q (2 * riskSigma C (errorOf p (run C p s₀ x t)) * p.ϱ)
(stepBuffer p (run C p s₀ x t) (x t))
else 0 := byMuon.Setup.update_eq_zero_iff source
theorem update_eq_zero_iff (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
(s₀ : AlgState m n) (x : ℕ → Batch m n B) (t : ℕ) :
tstop C p s₀ x ≤ (t : ℕ∞)
↔ riskSigma C (errorOf p (run C p s₀ x t)) = 0 := byMuon.Setup.tstop_le_iff source
theorem tstop_le_iff (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
(s₀ : AlgState m n) (x : ℕ → Batch m n B) (t : ℕ) :
tstop C p s₀ x ≤ (t : ℕ∞)
↔ ∃ u ≤ t, riskSigma C (errorOf p (run C p s₀ x u)) = 0 :=Muon.Setup.devRand_succ source
theorem devRand_succ (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
(s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) (ω : Ω) :
devRand C p s₀ x (t + 1) ω = devRand C p s₀ x t ω - p.η t • gtRand C p s₀ x t ω := byMuon.Setup.runRand_measurable source
theorem runRand_measurable {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω)
[IsProbabilityMeasure P] {C : Covariances m n} {ν : Measure (Vec m × Vec n)}
[IsProbabilityMeasure ν] {B : ℕ} (hM : ModelLaw P ν B) (p : AlgParams m n)
(s₀ : Ω → AlgState m n)
(hs₀W : ∀ i j, Measurable[hM.ℱ 0] fun ω => (s₀ ω).W i j)
(hs₀M : ∀ i j, Measurable[hM.ℱ 0] fun ω => (s₀ ω).Mprev i j) (t : ℕ) :
(∀ i j, Measurable[hM.ℱ t] fun ω => (runRand C p s₀ hM.x t ω).W i j)
∧ (∀ i j, Measurable[hM.ℱ t] fun ω => (runRand C p s₀ hM.x t ω).Mprev i j) := by