Bayesian interpretation of kernel regularization explained

Within bayesian statistics for machine learning, kernel methods arise from the assumption of an inner product space or similarity structure on inputs. For some such methods, such as support vector machines (SVMs), the original formulation and its regularization were not Bayesian in nature. It is helpful to understand them from a Bayesian perspective. Because the kernels are not necessarily positive semidefinite, the underlying structure may not be inner product spaces, but instead more general reproducing kernel Hilbert spaces. In Bayesian probability kernel methods are a key component of Gaussian processes, where the kernel function is known as the covariance function. Kernel methods have traditionally been used in supervised learning problems where the input space is usually a space of vectors while the output space is a space of scalars. More recently these methods have been extended to problems that deal with multiple outputs such as in multi-task learning.[1]

A mathematical equivalence between the regularization and the Bayesian point of view is easily proved in cases where the reproducing kernel Hilbert space is finite-dimensional. The infinite-dimensional case raises subtle mathematical issues; we will consider here the finite-dimensional case. We start with a brief review of the main ideas underlying kernel methods for scalar learning, and briefly introduce the concepts of regularization and Gaussian processes. We then show how both points of view arrive at essentially equivalent estimators, and show the connection that ties them together.

The supervised learning problem

The classical supervised learning problem requires estimating the output for some new input point

x'

by learning a scalar-valued estimator

\hat{f}(x')

on the basis of a training set

S

consisting of

n

input-output pairs,

S=(X,Y)=(x1,y1),\ldots,(xn,yn)

.[2] Given a symmetric and positive bivariate function

k(,)

called a kernel, one of the most popular estimators in machine learning is given by

where

K\equivk(X,X)

is the kernel matrix with entries

Kij=k(xi,xj)

,

k=[k(x1,x'),\ldots,k(x

\top
n,x')]
, and

Y=[y1,\ldots,y

\top
n]
. We will see how this estimator can be derived both from a regularization and a Bayesian perspective.

A regularization perspective

The main assumption in the regularization perspective is that the set of functions

l{F}

is assumed to belong to a reproducing kernel Hilbert space

l{H}k

.[3] [4]

Reproducing kernel Hilbert space

A reproducing kernel Hilbert space (RKHS)

l{H}k

is a Hilbert space of functions defined by a symmetric, positive-definite function

k:l{X} x l{X}R

called the reproducing kernel such that the function

k(x,)

belongs to

l{H}k

for all

x\inl{X}

.[5] [6] [7] There are three main properties make an RKHS appealing:

1. The reproducing property, which gives name to the space,

f(x)=\langlef,k(x,)\ranglek,\forallf\inl{H}k,

where

\langle,\ranglek

is the inner product in

l{H}k

.

2. Functions in an RKHS are in the closure of the linear combination of the kernel at given points,

f(x)=\sumik(xi,x)ci

.

This allows the construction in a unified framework of both linear and generalized linear models.

3. The squared norm in an RKHS can be written as

2
\|f\|
k

=\sumi,jk(xi,xj)cicj

and could be viewed as measuring the complexity of the function.

The regularized functional

The estimator is derived as the minimizer of the regularized functional

where

f\inl{H}k

and

\|\|k

is the norm in

l{H}k

. The first term in this functional, which measures the average of the squares of the errors between the

f(xi)

and the

yi

, is called the empirical risk and represents the cost we pay by predicting

f(xi)

for the true value

yi

. The second term in the functional is the squared norm in a RKHS multiplied by a weight

λ

and serves the purpose of stabilizing the problem as well as of adding a trade-off between fitting and complexity of the estimator. The weight

λ

, called the regularizer, determines the degree to which instability and complexity of the estimator should be penalized (higher penalty for increasing value of

λ

).

Derivation of the estimator

The explicit form of the estimator in equation is derived in two steps. First, the representer theorem[8] [9] [10] states that the minimizer of the functional can always be written as a linear combination of the kernels centered at the training-set points,

for some

c\inRn

. The explicit form of the coefficients

c=[c1,\ldots,c

\top
n]
can be found by substituting for

f()

in the functional . For a function of the form in equation, we have that
2
\begin{align} \|f\|
k

&=\langlef,f\ranglek,\\ &=\left\langle

N
\sum
i=1

cik(xi,),

N
\sum
j=1

cjk(xj,)\right\ranglek,\\ &=

N
\sum
i=1
N
\sum
j=1

cicj\langlek(xi,),k(xj,)\ranglek,\\ &=

N
\sum
i=1
N
\sum
j=1

cicjk(xi,xj),\\ &=c\topKc. \end{align}

We can rewrite the functional as

1
n

\|y-Kc\|2+λc\topKc.

This functional is convex in

c

and therefore we can find its minimum by setting the gradient with respect to

c

to zero,
\begin{align} -1
n

K(Y-Kc)+λKc&=0,\\ (K+λnI)c&=Y,\\ c&=(K+λnI)-1Y. \end{align}

Substituting this expression for the coefficients in equation, we obtain the estimator stated previously in equation,

\hat{f}(x')=k\top(K+λnI)-1Y.

A Bayesian perspective

The notion of a kernel plays a crucial role in Bayesian probability as the covariance function of a stochastic process called the Gaussian process.

A review of Bayesian probability

As part of the Bayesian framework, the Gaussian process specifies the prior distribution that describes the prior beliefs about the properties of the function being modeled. These beliefs are updated after taking into account observational data by means of a likelihood function that relates the prior beliefs to the observations. Taken together, the prior and likelihood lead to an updated distribution called the posterior distribution that is customarily used for predicting test cases.

The Gaussian process

A Gaussian process (GP) is a stochastic process in which any finite number of random variables that are sampled follow a joint Normal distribution. The mean vector and covariance matrix of the Gaussian distribution completely specify the GP. GPs are usually used as a priori distribution for functions, and as such the mean vector and covariance matrix can be viewed as functions, where the covariance function is also called the kernel of the GP. Let a function

f

follow a Gaussian process with mean function

m

and kernel function

k

,

f\siml{GP}(m,k).

In terms of the underlying Gaussian distribution, we have that for any finite set

X=\{xi\}

n
i=1
if we let

f(X)=[f(x1),\ldots,f(x

\top
n)]
then

f(X)\siml{N}(m,K),

where

m=m(X)=[m(x1),\ldots,m(x

\top
N)]
is the mean vector and

K=k(X,X)

is the covariance matrix of the multivariate Gaussian distribution.

Derivation of the estimator

In a regression context, the likelihood function is usually assumed to be a Gaussian distribution and the observations to be independent and identically distributed (iid),

p(y|f,x,\sigma2)=l{N}(f(x),\sigma2).

This assumption corresponds to the observations being corrupted with zero-mean Gaussian noise with variance

\sigma2

. The iid assumption makes it possible to factorize the likelihood function over the data points given the set of inputs

X

and the variance of the noise

\sigma2

, and thus the posterior distribution can be computed analytically. For a test input vector

x'

, given the training data

S=\{X,Y\}

, the posterior distribution is given by

p(f(x')|S,x',\boldsymbol{\phi})=l{N}(m(x'),\sigma2(x')),

where

\boldsymbol{\phi}

denotes the set of parameters which include the variance of the noise

\sigma2

and any parameters from the covariance function

k

and where

\begin{align} m(x')&=k\top(K+\sigma2I)-1Y,\\ \sigma2(x')&=k(x',x')-k\top(K+\sigma2I)-1k. \end{align}

The connection between regularization and Bayes

A connection between regularization theory and Bayesian theory can only be achieved in the case of finite dimensional RKHS. Under this assumption, regularization theory and Bayesian theory are connected through Gaussian process prediction.[11] [12]

In the finite dimensional case, every RKHS can be described in terms of a feature map

\Phi:l{X}Rp

such that

k(x,x')=

p
\sum
i=1

\Phii(x)\Phii(x').

Functions in the RKHS with kernel

K

can be then be written as

fw(x)=

p
\sum
i=1

wi\Phii(x)=\langlew,\Phi(x)\rangle,

and we also have that

\|fw\|k=\|w\|.

We can now build a Gaussian process by assuming

w=[w1,\ldots,wp]\top

to be distributed according to a multivariate Gaussian distribution with zero mean and identity covariance matrix,

w\siml{N}(0,I)\propto\exp(-\|w\|2).

If we assume a Gaussian likelihood we have

P(Y|X,f)=l{N}(f(X),\sigma2I)\propto\exp\left(-

1
\sigma2

\|fw(X)-Y\|2\right),

where

fw(X)=(\langlew,\Phi(x1)\rangle,\ldots,\langlew,\Phi(xn\rangle)

. The resulting posterior distribution is the given by

P(f|X,Y)\propto\exp\left(-

1
\sigma2

\|fw(X)-

2
Y\|
n

+\|w\|2\right)

We can see that a maximum posterior (MAP) estimate is equivalent to the minimization problem defining Tikhonov regularization, where in the Bayesian case the regularization parameter is related to the noise variance.

From a philosophical perspective, the loss function in a regularization setting plays a different role than the likelihood function in the Bayesian setting. Whereas the loss function measures the error that is incurred when predicting

f(x)

in place of

y

, the likelihood function measures how likely the observations are from the model that was assumed to be true in the generative process. From a mathematical perspective, however, the formulations of the regularization and Bayesian frameworks make the loss function and the likelihood function to have the same mathematical role of promoting the inference of functions

f

that approximate the labels

y

as much as possible.

See also

Notes and References

  1. Álvarez. Mauricio A.. Rosasco, Lorenzo . Lawrence, Neil D. . Kernels for Vector-Valued Functions: A Review. 1106.6251 . June 2011. stat.ML.
  2. Book: Vapnik, Vladimir. Statistical learning theory. 1998. Wiley. 9780471030034.
  3. Book: Schölkopf, Bernhard. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. 2002. MIT Press. 9780262194754. Smola, Alexander J..
  4. Girosi. F.. Poggio, T.. Networks and the best approximation property. Biological Cybernetics. 1990. 63. 3. 169–176. Springer. 10.1007/bf00195855. 1721.1/6017. 18824241. free.
  5. Aronszajn. N. Theory of Reproducing Kernels. Transactions of the American Mathematical Society. May 1950. 68. 3. 337–404. 10.2307/1990404. 1990404. free.
  6. Schwartz. Laurent. Laurent Schwartz. Sous-espaces hilbertiens d'espaces vectoriels topologiques et noyaux associés (noyaux reproduisants). Journal d'Analyse Mathématique. 1964. 13. 1. 115–256. Springer. 10.1007/bf02786620. 117202393.
  7. Cucker. Felipe. Smale, Steve. On the mathematical foundations of learning. Bulletin of the American Mathematical Society. October 5, 2001. 39. 1. 1–49. 10.1090/s0273-0979-01-00923-5. free.
  8. Kimeldorf. George S.. Wahba, Grace. A correspondence between Bayesian estimation on stochastic processes and smoothing by splines. The Annals of Mathematical Statistics. 1970. 41. 2. 495–502. 10.1214/aoms/1177697089. free.
  9. Book: Schölkopf, Bernhard. Herbrich, Ralf . Smola, Alex J. . Computational Learning Theory . A Generalized Representer Theorem . 2001. 2111/2001. 416–426. 10.1007/3-540-44581-1_27. Lecture Notes in Computer Science. 978-3-540-42343-0.
  10. De Vito. Ernesto. Rosasco, Lorenzo . Caponnetto, Andrea . Piana, Michele . Verri, Alessandro . Some Properties of Regularized Kernel Methods. Journal of Machine Learning Research. October 2004. 5. 1363–1390.
  11. Book: Wahba, Grace. Spline models for observational data. 1990. SIAM.
  12. Book: Rasmussen, Carl Edward. Gaussian Processes for Machine Learning. 2006. The MIT Press. 0-262-18253-X. Williams, Christopher K. I..