Rademacher complexity explained

In computational learning theory (machine learning and theory of computation), Rademacher complexity, named after Hans Rademacher, measures richness of a class of sets with respect to a probability distribution. The concept can also be extended to real valued functions.

Definitions

Rademacher complexity of a set

Given a set

A\subseteqRm

, the Rademacher complexity of A is defined as follows:[1] [2]

\operatorname{Rad}(A) :=

1
m

E\sigma\left[ \supa

m
\sum
i=1

\sigmaiai \right]

where

\sigma1,\sigma2,...,\sigmam

are independent random variables drawn from the Rademacher distribution i.e.

\Pr(\sigmai=+1)=\Pr(\sigmai=-1)=1/2

for

i=1,2,...,m

, and

a=(a1,\ldots,am)

. Some authors take the absolute value of the sum before taking the supremum, but if

A

is symmetric this makes no difference.

Rademacher complexity of a function class

Let

S=\{z1,z2,...,zm\}\subsetZ

be a sample of points and consider a function class

l{F}

of real-valued functions over

Z

. Then, the empirical Rademacher complexity of

l{F}

given

S

is defined as:

\operatorname{Rad}S(l{F}) =

1
m

E\sigma\left[ \supf

} \sum_^m \sigma_i f(z_i) \right]

This can also be written using the previous definition:[2]

\operatorname{Rad}S(l{F})=\operatorname{Rad}(l{F}\circS)

where

l{F}\circS

denotes function composition, i.e.:

l{F}\circS:=\{(f(z1),\ldots,f(zm))\midf\inl{F}\}

Let

P

be a probability distribution over

Z

. The Rademacher complexity of the function class

l{F}

with respect to

P

for sample size

m

is:

\operatorname{Rad}P,m(l{F}) :=

E
S\simPm

\left[\operatorname{Rad}S(l{F})\right]

where the above expectation is taken over an identically independently distributed (i.i.d.) sample

S=(z1,z2,...,zm)

generated according to

P

.

Intuition

The Rademacher complexity is typically applied on a function class of models that are used for classification, with the goal of measuring their ability to classify points drawn from a probability space under arbitrary labellings. When the function class is rich enough, it contains functions that can appropriately adapt for each arrangement of labels, simulated by the random draw of

\sigmai

under the expectation, so that this quantity in the sum is maximised.

Examples

1.

A

contains a single vector, e.g.,

A=\{(a,b)\}\subsetR2

. Then:

\operatorname{Rad}(A)={1\over2}\left({1\over4}(a+b)+{1\over4}(a-b)+{1\over4}(-a+b)+{1\over4}(-a-b)\right)=0

The same is true for every singleton hypothesis class.

2.

A

contains two vectors, e.g.,

A=\{(1,1),(1,2)\}\subsetR2

. Then:

\begin{align} \operatorname{Rad}(A)&={1\over2}\left({1\over4} ⋅ max(1+1,1+2)+{1\over4} ⋅ max(1-1,1-2)+{1\over4}max(-1+1,-1+2)+{1\over4} ⋅ max(-1-1,-1-2)\right)\\[5pt] &={1\over8}(3+0+1-2)={1\over4} \end{align}

Using the Rademacher complexity

The Rademacher complexity can be used to derive data-dependent upper-bounds on the learnability of function classes. Intuitively, a function-class with smaller Rademacher complexity is easier to learn.

Bounding the representativeness

In machine learning, it is desired to have a training set that represents the true distribution of some sample data

S

. This can be quantified using the notion of representativeness. Denote by

P

the probability distribution from which the samples are drawn. Denote by

H

the set of hypotheses (potential classifiers) and denote by

F

the corresponding set of error functions, i.e., for every hypothesis

h\inH

, there is a function

fh\inF

, that maps each training sample (features,label) to the error of the classifier

h

(note in this case hypothesis and classifier are used interchangeably). For example, in the case that

h

represents a binary classifier, the error function is a 0–1 loss function, i.e. the error function

fh

returns 0 if

h

correctly classifies a sample and 1 else. We omit the index and write

f

instead of

fh

when the underlying hypothesis is irrelevant. Define:

LP(f):=Ez\sim[f(z)]

– the expected error of some error function

f\inF

on the real distribution

P

;

LS(f):={1\overm}

m
\sum
i=1

f(zi)

– the estimated error of some error function

f\inF

on the sample

S

.The representativeness of the sample

S

, with respect to

P

and

F

, is defined as:

\operatorname{Rep}P(F,S):=\supf\in(LP(f)-LS(f))

Smaller representativeness is better, since it provides a way to avoid overfitting: it means that the true error of a classifier is not much higher than its estimated error, and so selecting a classifier that has low estimated error will ensure that the true error is also low. Note however that the concept of representativeness is relative and hence can not be compared across distinct samples.

The expected representativeness of a sample can be bounded above by the Rademacher complexity of the function class:[2]

\mathbb E_ [\operatorname{Rep}_P(F,S)] \leq 2 \cdot \mathbb E_ [\operatorname{Rad}(F\circ S)]

Bounding the generalization error

When the Rademacher complexity is small, it is possible to learn the hypothesis class H using empirical risk minimization.

For example, (with binary error function),[2] for every

\delta>0

, with probability at least

1-\delta

, for every hypothesis

h\inH

:

LP(h)-LS(h)\leq2\operatorname{Rad}(F\circS)+4\sqrt{2ln(4/\delta)\overm}

Bounding the Rademacher complexity

Since smaller Rademacher complexity is better, it is useful to have upper bounds on the Rademacher complexity of various function sets. The following rules can be used to upper-bound the Rademacher complexity of a set

A\subsetRm

.[2]

1. If all vectors in

A

are translated by a constant vector

a0\inRm

, then Rad(A) does not change.

2. If all vectors in

A

are multiplied by a scalar

c\inR

, then Rad(A) is multiplied by

|c|

.

3.

\operatorname{Rad}(A+B)=\operatorname{Rad}(A)+\operatorname{Rad}(B)

.

4. (Kakade & Tewari Lemma) If all vectors in

A

are operated by a Lipschitz function, then Rad(A) is (at most) multiplied by the Lipschitz constant of the function. In particular, if all vectors in

A

are operated by a contraction mapping, then Rad(A) strictly decreases.

5. The Rademacher complexity of the convex hull of

A

equals Rad(A).

6. (Massart Lemma) The Rademacher complexity of a finite set grows logarithmically with the set size. Formally, let

A

be a set of

N

vectors in

Rm

, and let

\bar{a}

be the mean of the vectors in

A

. Then:

\operatorname{Rad}(A)\leqmaxa\in\|a-\bar{a}\|{\sqrt{2logN}\overm}

In particular, if

A

is a set of binary vectors, the norm is at most

\sqrt{m}

, so:

\operatorname{Rad}(A)\leq\sqrt{2logN\overm}

Bounds related to the VC dimension

Let

H

be a set family whose VC dimension is

d

. It is known that the growth function of

H

is bounded as:

for all

m>d+1

:

\operatorname{Growth}(H,m)\leq(em/d)d

This means that, for every set

h

with at most

m

elements,

|H\caph|\leq(em/d)d

. The set-family

H\caph

can be considered as a set of binary vectors over

Rm

. Substituting this in Massart's lemma gives:

\operatorname{Rad}(H\caph)\leq{\sqrt{2dlog(em/d)\overm}}

With more advanced techniques (Dudley's entropy bound and Haussler's upper bound[3]) one can show, for example, that there exists a constant

C

, such that any class of

\{0,1\}

-indicator functions with Vapnik–Chervonenkis dimension

d

has Rademacher complexity upper-bounded by
C\sqrt{d
m
}.

Bounds related to linear classes

The following bounds are related to linear operations on

S

– a constant set of

m

vectors in

Rn

.[2]

1. Define

A2=\{(wx1,\ldots,wxm)\mid\|w\|2\leq1\}=

the set of dot-products of the vectors in

S

with vectors in the unit ball. Then:

\operatorname{Rad}(A2)\leq{maxi\|xi\|2\over\sqrt{m}}

2. Define

A1=\{(wx1,\ldots,wxm)\mid\|w\|1\leq1\}=

the set of dot-products of the vectors in

S

with vectors in the unit ball of the 1-norm. Then:

\operatorname{Rad}(A1)\leqmaxi\|xi\|infty\sqrt{2log(2n)\overm}

Bounds related to covering numbers

The following bound relates the Rademacher complexity of a set

A

to its external covering number – the number of balls of a given radius

r

whose union contains

A

. The bound is attributed to Dudley.[2]

Suppose

A\subsetRm

is a set of vectors whose length (norm) is at most

c

. Then, for every integer

M>0

:

\operatorname{Rad}(A)\leq{c2-M\over\sqrt{m}} + {6c\over

M
m} \sum
i=1

2-i

ext
\sqrt{log\left(N
c ⋅ 2-i

(A)\right)}

In particular, if

A

lies in a d-dimensional subspace of

Rm

, then:

\forallr>0:

ext
N
r(A)

\leq(2c\sqrt{d}/r)d

Substituting this in the previous bound gives the following bound on the Rademacher complexity:

\operatorname{Rad}(A)\leq{6c\overm} (\sqrt{dlog(2\sqrt{d})}+2\sqrt{d}) = O({c\sqrt{dlog(d)}\overm})

Gaussian complexity

Gaussian complexity is a similar complexity with similar physical meanings, and can be obtained from the Rademacher complexity using the random variables

gi

instead of

\sigmai

, where

gi

are Gaussian i.i.d. random variables with zero-mean and variance 1, i.e.

gi\siml{N}(0,1)

. Gaussian and Rademacher complexities are known to be equivalent up to logarithmic factors.

Equivalence of Rademacher and Gaussian complexity

Given a set

A\subseteqRn

then it holds that[4] :
G(A)
2\sqrt{log{n
}} \leq \text(A) \leq \sqrtG(A)
Where

G(A)

is the Gaussian Complexity of A. As an example, consider the rademacher and gaussian complexities of the L1 ball. The Rademacher complexity is given by exactly 1, whereas the Gaussian complexity is on the order of

\sqrt{logd}

(which can be shown by applying known properties of suprema of a set of subgaussian random variables).

References

Notes and References

  1. Web site: Balcan. Maria-Florina. Maria-Florina Balcan . Machine Learning Theory – Rademacher Complexity. 10 December 2016. November 15–17, 2011.
  2. Chapter 26 in
  3. Bousquet, O. (2004). Introduction to Statistical Learning Theory. Biological Cybernetics, 3176(1), 169–207.
  4. Book: Wainwright, Martin . High-dimensional statistics : a non-asymptotic viewpoint . 2019 . 978-1-108-62777-1 . Cambridge, United Kingdom . Exercise 5.5 . 1089254580.