Documentation

CslibFrontier.MachineLearning.Rademacher.Contraction

Talagrand's contraction lemma for Rademacher complexity #

Composing a bounded family of vectors a : ι → Fin m → ℝ coordinatewise with K-Lipschitz functions φ i : ℝ → ℝ multiplies its Rademacher average by at most K: rademacherAverage (fun j i => φ i (a j i)) ≤ K * rademacherAverage a [MohriRostamizadehTalwalkar2018, Lemma 5.7]; cf. [LedouxTalagrand1991, Theorem 4.12, pp. 112–114] and [ShalevShwartzBenDavid2014, Lemma 26.9]. No centering assumption φ i 0 = 0 is required: shifting φ i by a constant changes every vector by a fixed coordinate offset, which cancels in expectation against a symmetric sign.

The proof follows [MohriRostamizadehTalwalkar2018, Lemma 5.7], replacing (K : ℝ) * a j i by φ i (a j i) one coordinate at a time. At coordinate i₀, pairing each sign vector σ with its flip at i₀ reduces the step to the elementary two-branch inequality (⨆ j, (u j + g (x j))) + (⨆ j, (u j - g (x j))) ≤ (⨆ j, (u j + K * x j)) + ⨆ j, (u j - K * x j) for a K-Lipschitz map g.

Specializing to restrictions of a uniformly bounded hypothesis class F : Set (X → ℝ) yields contraction bounds for empirical and expected Rademacher complexities, both for direct composition (φ ∘ ·) '' F and for sample-dependent per-example losses (fun f z => φ z (f (g z))) '' F such as margin losses on labeled examples.

Main results #

References #

Single-coordinate contraction helpers #

Vector contraction #

theorem Cslib.MachineLearning.rademacherAverage_comp_le {ι : Type u_1} {m : ℕ} {a : ι → Fin m → ℝ} {B : ℝ} (ha : ∀ (j : ι) (i : Fin m), |a j i| ≤ B) {φ : Fin m → ℝ → ℝ} {K : NNReal} (hφ : ∀ (i : Fin m), LipschitzWith K (φ i)) :
(rademacherAverage fun (j : ι) (i : Fin m) => φ i (a j i)) ≤ ↑K * rademacherAverage a

Talagrand's contraction lemma [MohriRostamizadehTalwalkar2018, Lemma 5.7] (cf. [LedouxTalagrand1991, Theorem 4.12, pp. 112–114]): for a bounded family of vectors a : ι → Fin m → ℝ and K-Lipschitz functions φ i : ℝ → ℝ (i : Fin m), rademacherAverage (fun j i => φ i (a j i)) ≤ K * rademacherAverage a. No centering condition φ i 0 = 0 is needed.

Function-class contraction #

theorem Cslib.MachineLearning.rademacherAverage_comp_le_empiricalRademacherComplexity {Z : Type u_1} {F : Set (Z → ℝ)} {B : ℝ} (hF : ∀ f ∈ F, ∀ (z : Z), |f z| ≤ B) {m : ℕ} (S : Fin m → Z) {φ : Fin m → ℝ → ℝ} {K : NNReal} (hφ : ∀ (i : Fin m), LipschitzWith K (φ i)) :
(rademacherAverage fun (f : ↑F) (i : Fin m) => φ i (↑f (S i))) ≤ ↑K * empiricalRademacherComplexity F S

Talagrand's contraction lemma for a function class [MohriRostamizadehTalwalkar2018, Lemma 5.7]: for a uniformly bounded class F : Set (Z → ℝ), a sample S : Fin m → Z, and K-Lipschitz maps φ i : ℝ → ℝ, rademacherAverage (fun (f : F) i => φ i (f (S i))) ≤ K * empiricalRademacherComplexity F S.

theorem Cslib.MachineLearning.empiricalRademacherComplexity_image_comp_le_of_map {Z : Type u_1} {X : Type u_2} {F : Set (X → ℝ)} {B : ℝ} (hF : ∀ f ∈ F, ∀ (x : X), |f x| ≤ B) (g : Z → X) {φ : Z → ℝ → ℝ} {K : NNReal} (hφ : ∀ (z : Z), LipschitzWith K (φ z)) {m : ℕ} (S : Fin m → Z) :
empiricalRademacherComplexity ((fun (f : X → ℝ) (z : Z) => φ z (f (g z))) '' F) S ≤ ↑K * empiricalRademacherComplexity F fun (i : Fin m) => g (S i)

Empirical Rademacher contraction under example-dependent Lipschitz maps: if F is a uniformly bounded set of functions X → ℝ, g : Z → X extracts features from examples, and φ z : ℝ → ℝ is K-Lipschitz for every z : Z, then on any sample S : Fin m → Z the induced class {(z ↦ φ z (f (g z))) | f ∈ F} has empirical Rademacher complexity at most K times that of F on g ∘ S.

theorem Cslib.MachineLearning.empiricalRademacherComplexity_image_comp_le {Z : Type u_1} {F : Set (Z → ℝ)} {B : ℝ} (hF : ∀ f ∈ F, ∀ (z : Z), |f z| ≤ B) {φ : ℝ → ℝ} {K : NNReal} (hφ : LipschitzWith K φ) {m : ℕ} (S : Fin m → Z) :
empiricalRademacherComplexity ((fun (x : Z → ℝ) => φ ∘ x) '' F) S ≤ ↑K * empiricalRademacherComplexity F S

Empirical Rademacher contraction for (φ ∘ ·) '' F [MohriRostamizadehTalwalkar2018, Lemma 5.7]: composing a uniformly bounded class F : Set (Z → ℝ) with a K-Lipschitz function φ : ℝ → ℝ multiplies its empirical Rademacher complexity by at most K.

theorem Cslib.MachineLearning.rademacherComplexity_image_comp_le_of_map {Z : Type u_1} {X : Type u_2} [Fintype Z] [Fintype X] (D : PMF Z) {F : Set (X → ℝ)} {B : ℝ} (hF : ∀ f ∈ F, ∀ (x : X), |f x| ≤ B) (g : Z → X) {φ : Z → ℝ → ℝ} {K : NNReal} (hφ : ∀ (z : Z), LipschitzWith K (φ z)) (m : ℕ) :
rademacherComplexity D ((fun (f : X → ℝ) (z : Z) => φ z (f (g z))) '' F) m ≤ ↑K * rademacherComplexity (PMF.map g D) F m

Population Rademacher contraction under example-dependent Lipschitz maps: under a distribution D : PMF Z on a finite domain, the class {(z ↦ φ z (f (g z))) | f ∈ F} has Rademacher complexity at most K times that of F under D.map g.

theorem Cslib.MachineLearning.rademacherComplexity_image_comp_le {Z : Type u_1} [Fintype Z] (D : PMF Z) {F : Set (Z → ℝ)} {B : ℝ} (hF : ∀ f ∈ F, ∀ (z : Z), |f z| ≤ B) {φ : ℝ → ℝ} {K : NNReal} (hφ : LipschitzWith K φ) (m : ℕ) :
rademacherComplexity D ((fun (x : Z → ℝ) => φ ∘ x) '' F) m ≤ ↑K * rademacherComplexity D F m

Population Rademacher contraction for (φ ∘ ·) '' F [MohriRostamizadehTalwalkar2018, Lemma 5.7]: composing a uniformly bounded class F : Set (Z → ℝ) with a K-Lipschitz function φ : ℝ → ℝ multiplies its Rademacher complexity under D by at most K.