Theorem 26.5: for |ℓ| ≤ c, w.p. ≥ 1−δ, ∀h∈H: L_D(h) − L_S(h) ≤ 2E R + c√(2ln(2/δ)/m); ≤ 2R(ℓ∘H∘S) + 4c√(2ln(4/δ)/m); and L_D(ERM) − L_D(h⋆) ≤ 2R(ℓ∘H∘S) + 5c√(2ln(8/δ)/m)
ProvedUnderstandingML.rademacher_generalizationTheorem 26.5. Assume that for all and we have that . Then,
- With probability of at least , for all , . In particular, this holds for .
- With probability of at least , for all , . In particular, this holds for .
- For any , with probability of at least , .
Formally: each part bounds the probability of the failure event by ; part 3 for every ERM learner and . The loss is bounded by and measurable, is nonempty, , and the maps and are measurable (Remark 3.1).
The double-sample measurability. Besides and , the item assumes that is measurable, because the proof of Lemma 26.2 integrates it. Swapping and preserves , so equals its average over sign vectors . That average is at most pointwise. Without this hypothesis the per- suprema need not be measurable, and their upper integrals can exceed the integral of their average , so the argument does not close. The hypothesis holds whenever the loss class has a countable pointwise-dense subclass, as in Theorems 26.12-26.15.
import Definitions.Def_UnderstandingML_Rademacher open MeasureTheory open scoped InnerProductSpace
namespace UnderstandingML
/-- **Theorem 26.5** (p. 378). Assume that for all `z` and `h ∈ H` we have `|ℓ(h, z)| ≤ c`. Then:
1. with probability at least `1 − δ`, for all `h ∈ H`,
`L_D(h) − L_S(h) ≤ 2 E_{S' ∼ D^m} R(ℓ ∘ H ∘ S') + c √(2 ln(2/δ)/m)`;
2. with probability at least `1 − δ`, for all `h ∈ H`,
`L_D(h) − L_S(h) ≤ 2 R(ℓ ∘ H ∘ S) + 4c √(2 ln(4/δ)/m)`;
3. for any `h⋆`, with probability at least `1 − δ`,
`L_D(ERM_H(S)) − L_D(h⋆) ≤ 2 R(ℓ ∘ H ∘ S) + 5c √(2 ln(8/δ)/m)`.
Each holds in particular for `h = ERM_H(S)`. Hypotheses as in Lemma 26.2; part 3 for an ERM
learner and `h⋆ ∈ H`. -/
theorem rademacher_generalization {Z Hyp : Type*} [MeasurableSpace Z]
(loss : Hyp → Z → ℝ) (H : Set Hyp) (hH : H.Nonempty) (c : ℝ)
(hc : ∀ h ∈ H, ∀ z, |loss h z| ≤ c) (hmeas : ∀ h ∈ H, Measurable (loss h))
(D : Measure Z) [IsProbabilityMeasure D] (m : ℕ) (hm : 0 < m)
(hrep : Measurable (fun S : Fin m → Z ↦ representativeness loss H D S))
(hrad : Measurable (fun S : Fin m → Z ↦ rademacher (evalSet (lossClass loss H) S)))
(hdbl : Measurable (fun p : (Fin m → Z) × (Fin m → Z) ↦
⨆ h : H, (empRisk loss p.2 (h : Hyp) - empRisk loss p.1 (h : Hyp))))
(δ : ℝ) (hδ : 0 < δ) (hδ1 : δ < 1) :
(iidLaw D m {S | ∃ h ∈ H,
2 * (∫ S', rademacher (evalSet (lossClass loss H) S') ∂(iidLaw D m)) +
c * Real.sqrt (2 * Real.log (2 / δ) / m) < risk loss D h - empRisk loss S h} ≤
ENNReal.ofReal δ) ∧
(iidLaw D m {S | ∃ h ∈ H,
2 * rademacher (evalSet (lossClass loss H) S) + 4 * c * Real.sqrt (2 * Real.log (4 / δ) / m) <
risk loss D h - empRisk loss S h} ≤ ENNReal.ofReal δ) ∧
(∀ (A : Learner Z Hyp), IsERMLearner loss H A → ∀ hstar ∈ H,
iidLaw D m {S | 2 * rademacher (evalSet (lossClass loss H) S) +
5 * c * Real.sqrt (2 * Real.log (8 / δ) / m) < risk loss D (A m S) - risk loss D hstar} ≤
ENNReal.ofReal δ) := by sorry
end UnderstandingML
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.