Rademacher generalization bounds #
For a class F of functions from a finite domain Z into [a, b] and a sample S of m
independent draws from a distribution D, the population mean â z, D z f z of every f â F
exceeds its empirical mean đŧ i, f (S i) by at most twice the Rademacher complexity plus a
deviation term. With probability at least 1 - δ, for all f â F,
E_D f ⤠Ã_S f + 2 R_m(F) + (b - a) â(log (1 / δ) / (2 m)), andE_D f ⤠Ã_S f + 2 RĖ_S(F) + 3 (b - a) â(log (2 / δ) / (2 m)),
[MohriRostamizadehTalwalkar2018, Theorem 3.3] (stated there for [0, 1]-valued classes, the case
a = 0, b = 1); see also [ShalevShwartzBenDavid2014, Chapter 26], and cf.
[BartlettMendelson2002, Theorem 8], a variant for loss classes with a different normalization of the
Rademacher complexity and different constants.
The second bound is data-dependent: its complexity term can be computed from the sample.
The proof has two parts.
- Symmetrization [MohriRostamizadehTalwalkar2018, (3.8)â(3.13)]. The expected worst-case gap
ÎĻ(S) = sup_{f â F} (E_D f - Ã_S f)is at most2 R_m(F). ReplaceE_D fby the empirical mean on an independent ghost sampleS'. ExchangingS iwithS' iat the positions where a sign vectorĪistruepreserves the joint distribution and multiplies thei-th difference by the signĪ_i. Averaging overĪand splitting the supremum of the sum bounds the result byRĖ_{S'}(F) + RĖ_S(F). - Concentration. Changing one sample point changes
ÎĻandRĖ_S(F)by at most(b - a) / m, so McDiarmid's inequality (Cslib.Probability.HasBoundedDifferences.pi_ge_mean_add) bounds the probability thatÎĻexceeds its mean byÎĩ, or thatRĖ_S(F)falls short ofR_m(F)byÎĩ, byexp (-2 m Îĩ² / (b - a)²).
Probabilities are the outer measures of the finite product distribution
Cslib.Probability.PMF.pi, and each theorem bounds the probability of the failure event by δ.
Main results #
Cslib.MachineLearning.sum_pi_mul_ciSup_sub_le_two_mul_rademacherComplexity: symmetrization,đŧ_S sup_f (E_D f - Ã_S f) ⤠2 R_m(F).Cslib.MachineLearning.hasBoundedDifferences_empiricalRademacherComplexity: the empirical Rademacher complexity has bounded differences(b - a) / m.Cslib.MachineLearning.rademacherComplexity_generalization_bound: the bound withR_m(F).Cslib.MachineLearning.empiricalRademacherComplexity_generalization_bound: the data-dependent bound withRĖ_S(F).Cslib.MachineLearning.rademacher_generalization_bound_of_finset: a finite class with values in[0, 1], through Massart's lemma.
References #
- M. Mohri, A. Rostamizadeh, A. Talwalkar, Foundations of Machine Learning, 2nd ed., Theorem 3.3
- P. L. Bartlett, S. Mendelson, Rademacher and Gaussian complexities: risk bounds and structural results, Theorem 8 (a variant with a different normalization and constants)
- S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Chapter 26
- C. McDiarmid, On the method of bounded differences
Boundedness helpers #
Symmetrization #
Symmetrization [MohriRostamizadehTalwalkar2018, (3.8)â(3.13)]: for a class bounded by
B and samples of size m > 0, the expected worst-case gap between population and empirical
means is at most twice the Rademacher complexity,
đŧ_S sup_{f â F} (E_D f - Ã_S f) ⤠2 R_m(F).
Bounded differences #
The empirical Rademacher complexity of a class with values in [a, b] has bounded differences
(b - a) / m as a function of the sample [MohriRostamizadehTalwalkar2018, proof of Theorem 3.3].
Generalization bounds #
Rademacher generalization bound [MohriRostamizadehTalwalkar2018, Theorem 3.3, (3.3)]:
for a class F of functions with values in [a, b] and m > 0 independent draws from D, the
probability that some f â F has
E_D f > Ã_S f + 2 R_m(F) + (b - a) â(log (1 / δ) / (2 m)) is at most δ. The source states
the case [a, b] = [0, 1].
Data-dependent Rademacher generalization bound [MohriRostamizadehTalwalkar2018,
Theorem 3.3, (3.4)]: for a class F of functions with values in [a, b] and m > 0 independent
draws from D, the probability that some f â F has
E_D f > Ã_S f + 2 RĖ_S(F) + 3 (b - a) â(log (2 / δ) / (2 m)) is at most δ. The source states
the case [a, b] = [0, 1]. The proof combines the expected bound at confidence δ / 2 with
McDiarmid's lower tail for RĖ_S(F) at confidence δ / 2.
Generalization bound for a finite class with values in [0, 1], through Massart's
lemma: the probability that some f â F has
E_D f > Ã_S f + 2 â(2 log |F| / m) + â(log (1 / δ) / (2 m)) is at most δ
[MohriRostamizadehTalwalkar2018, Theorem 3.3 and Theorem 3.7]. This illustrates the method;
Hoeffding's inequality with a union bound gives the sharper â(log (|F| / δ) / (2 m)).