Bayesian interpretation of kernel regularization

From Wikipedia, the free encyclopedia

Bayesian interpretation of kernel regularization examines how kernel methods in machine learning can be understood through the lens of Bayesian statistics, a framework that uses probability to model uncertainty. Kernel methods are founded on the concept of similarity between inputs within a structured space. While techniques like support vector machines (SVMs) and their regularization (a technique to make a model more generalizable and transferable) were not originally formulated using Bayesian principles, analyzing them from a Bayesian perspective provides valuable insights.

In the Bayesian framework, kernel methods serve as a fundamental component of Gaussian processes, where the kernel function operates as a covariance function that defines relationships between inputs. Traditionally, these methods have been applied to supervised learning problems where inputs are represented as vectors and outputs as scalars. Recent developments have extended kernel methods to handle multiple outputs, as seen in multi-task learning.[1]

The mathematical framework for kernel methods typically involves reproducing kernel Hilbert spaces (RKHS). Not all kernels form inner product spaces, as they may not always be positive semidefinite (a property ensuring non-negative similarity measures), but they still operate within these more general RKHS. A mathematical equivalence between regularization approaches and Bayesian methods can be established, particularly in cases where the reproducing kernel Hilbert space is finite-dimensional. This equivalence demonstrates how both perspectives converge to essentially the same estimators, revealing the underlying connection between these seemingly different approaches.

The supervised learning problem

The classical supervised learning problem requires estimating the output for some new input point 𝐱 by learning a scalar-valued estimator fΜ‚(𝐱) on the basis of a training set S consisting of n input-output pairs, S=(𝐗,𝐘)=(𝐱1,y1),…,(𝐱n,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

Template:NumBlk

where πŠβ‰‘k(𝐗,𝐗) is the kernel matrix with entries 𝐊ij=k(𝐱i,𝐱j), 𝐀=[k(𝐱1,𝐱),…,k(𝐱n,𝐱)]⊀, and 𝐘=[y1,…,yn]⊀. 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 β„± is assumed to belong to a reproducing kernel Hilbert space β„‹k.[2][3][4][5]

Reproducing kernel Hilbert space

A reproducing kernel Hilbert space (RKHS) β„‹k is a Hilbert space of functions defined by a symmetric, positive-definite function k:𝒳×𝒳→ℝ called the reproducing kernel such that the function k(𝐱,β‹…) belongs to β„‹k for all π±βˆˆπ’³.[6][7][8] There are three main properties that make an RKHS appealing:

1. The reproducing property, after which the RKHS is named,

f(𝐱)=⟨f,k(𝐱,β‹…)⟩k,βˆ€ fβˆˆβ„‹k,

where βŸ¨β‹…,β‹…βŸ©k is the inner product in β„‹k.

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

f(𝐱)=βˆ‘ik(𝐱i,𝐱)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

β€–fβ€–k2=βˆ‘i,jk(𝐱i,𝐱j)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

Template:NumBlk

where fβˆˆβ„‹k and β€–β‹…β€–k is the norm in β„‹k. The first term in this functional, which measures the average of the squares of the errors between the f(𝐱i) and the yi, is called the empirical risk and represents the cost we pay by predicting f(𝐱i) 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[3][5] as well as of adding a trade-off between fitting and complexity of the estimator.[2] 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 (1) is derived in two steps. First, the representer theorem[9][10][11] states that the minimizer of the functional (2) can always be written as a linear combination of the kernels centered at the training-set points,

Template:NumBlk

for some πœβˆˆβ„n. The explicit form of the coefficients 𝐜=[c1,…,cn]⊀ can be found by substituting for f(β‹…) in the functional (2). For a function of the form in equation (3), we have that

β€–fβ€–k2=⟨f,f⟩k,=βŸ¨βˆ‘i=1Ncik(𝐱i,β‹…),βˆ‘j=1Ncjk(𝐱j,β‹…)⟩k,=βˆ‘i=1Nβˆ‘j=1Ncicj⟨k(𝐱i,β‹…),k(𝐱j,β‹…)⟩k,=βˆ‘i=1Nβˆ‘j=1Ncicjk(𝐱i,𝐱j),=𝐜⊀𝐊𝐜.

We can rewrite the functional (2) as

1nβ€–π²βˆ’πŠπœβ€–2+λ𝐜⊀𝐊𝐜.

This functional is convex in 𝐜 and therefore we can find its minimum by setting the gradient with respect to 𝐜 to zero,

βˆ’1n𝐊(π˜βˆ’πŠπœ)+λ𝐊𝐜=0,(𝐊+Ξ»n𝐈)𝐜=𝐘,𝐜=(𝐊+Ξ»n𝐈)βˆ’1𝐘.

Substituting this expression for the coefficients in equation (3), we obtain the estimator stated previously in equation (1),

fΜ‚(𝐱)=𝐀⊀(𝐊+Ξ»n𝐈)βˆ’1𝐘.

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.[12] 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βˆΌπ’’π’«(m,k).

In terms of the underlying Gaussian distribution, we have that for any finite set 𝐗={𝐱i}i=1n if we let f(𝐗)=[f(𝐱1),…,f(𝐱n)]⊀ then

f(𝐗)βˆΌπ’©(𝐦,𝐊),

where 𝐦=m(𝐗)=[m(𝐱1),…,m(𝐱N)]⊀ is the mean vector and 𝐊=k(𝐗,𝐗) is the covariance matrix of the multivariate Gaussian distribution.

Derivation of the estimator

Script error: No such module "labelled list hatnote". 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,𝐱,Οƒ2)=𝒩(f(𝐱),Οƒ2).

This assumption corresponds to the observations being corrupted with zero-mean Gaussian noise with variance Οƒ2. The iid assumption makes it possible to factorize the likelihood function over the data points given the set of inputs 𝐗 and the variance of the noise Οƒ2, and thus the posterior distribution can be computed analytically. For a test input vector 𝐱, given the training data S={𝐗,𝐘}, the posterior distribution is given by

p(f(𝐱)|S,𝐱,𝝓)=𝒩(m(𝐱),Οƒ2(𝐱)),

where 𝝓 denotes the set of parameters which include the variance of the noise Οƒ2 and any parameters from the covariance function k and where

m(𝐱)=𝐀⊀(𝐊+Οƒ2𝐈)βˆ’1𝐘,Οƒ2(𝐱)=k(𝐱,𝐱)βˆ’π€βŠ€(𝐊+Οƒ2𝐈)βˆ’1𝐀.

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.[3][12][13]

In the finite dimensional case, every RKHS can be described in terms of a feature map Ξ¦:𝒳→ℝp such that[2]

k(𝐱,𝐱)=βˆ‘i=1pΞ¦i(𝐱)Ξ¦i(𝐱).

Functions in the RKHS with kernel 𝐊 can then be written as

f𝐰(𝐱)=βˆ‘i=1p𝐰iΞ¦i(𝐱)=⟨𝐰,Ξ¦(𝐱)⟩,

and we also have that

β€–f𝐰‖k=‖𝐰‖.

We can now build a Gaussian process by assuming 𝐰=[w1,…,wp]⊀ to be distributed according to a multivariate Gaussian distribution with zero mean and identity covariance matrix,

π°βˆΌπ’©(0,𝐈)∝exp(βˆ’β€–π°β€–2).

If we assume a Gaussian likelihood we have

P(𝐘|𝐗,f)=𝒩(f(𝐗),Οƒ2𝐈)∝exp(βˆ’1Οƒ2β€–f𝐰(𝐗)βˆ’π˜β€–2),

where f𝐰(𝐗)=(⟨𝐰,Ξ¦(𝐱1)⟩,…,⟨𝐰,Ξ¦(𝐱n⟩). The resulting posterior distribution is then given by

P(f|𝐗,𝐘)∝exp(βˆ’1Οƒ2β€–f𝐰(𝐗)βˆ’π˜β€–n2+‖𝐰‖2)

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(𝐱) 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

References

Page Template:Reflist/styles.css has no content.

  1. ^ Page Module:Citation/CS1/styles.css has no content.Álvarez, Mauricio A.; Rosasco, Lorenzo; Lawrence, Neil D. (June 2011). "Kernels for Vector-Valued Functions: A Review". arXiv:1106.6251 [stat.ML].
  2. ^ a b c d Page Module:Citation/CS1/styles.css has no content.Vapnik, Vladimir (1998). Statistical learning theory. Wiley. ISBN 9780471030034.
  3. ^ a b c Page Module:Citation/CS1/styles.css has no content.Wahba, Grace (1990). Spline models for observational data. SIAM. Bibcode:1990smod.conf.....W.
  4. ^ Page Module:Citation/CS1/styles.css has no content.SchΓΆlkopf, Bernhard; Smola, Alexander J. (2002). Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. MIT Press. ISBN 9780262194754.
  5. ^ a b Page Module:Citation/CS1/styles.css has no content.Girosi, F.; Poggio, T. (1990). "Networks and the best approximation property" (PDF). Biological Cybernetics. 63 (3). Springer: 169–176. doi:10.1007/bf00195855. hdl:1721.1/6017. S2CID 18824241.
  6. ^ Page Module:Citation/CS1/styles.css has no content.Aronszajn, N (May 1950). "Theory of Reproducing Kernels". Transactions of the American Mathematical Society. 68 (3): 337–404. doi:10.2307/1990404. JSTOR 1990404.
  7. ^ Page Module:Citation/CS1/styles.css has no content.Schwartz, Laurent (1964). "Sous-espaces hilbertiens d'espaces vectoriels topologiques et noyaux associΓ©s (noyaux reproduisants)". Journal d'Analyse MathΓ©matique. 13 (1). Springer: 115–256. doi:10.1007/bf02786620. S2CID 117202393.
  8. ^ Page Module:Citation/CS1/styles.css has no content.Cucker, Felipe; Smale, Steve (October 5, 2001). "On the mathematical foundations of learning". Bulletin of the American Mathematical Society. 39 (1): 1–49. doi:10.1090/s0273-0979-01-00923-5.
  9. ^ Page Module:Citation/CS1/styles.css has no content.Kimeldorf, George S.; Wahba, Grace (1970). "A correspondence between Bayesian estimation on stochastic processes and smoothing by splines". The Annals of Mathematical Statistics. 41 (2): 495–502. doi:10.1214/aoms/1177697089.
  10. ^ Page Module:Citation/CS1/styles.css has no content.SchΓΆlkopf, Bernhard; Herbrich, Ralf; Smola, Alex J. (2001). "A Generalized Representer Theorem". Computational Learning Theory. Lecture Notes in Computer Science. Vol. 2111/2001. pp. 416–426. doi:10.1007/3-540-44581-1_27. ISBN 978-3-540-42343-0.
  11. ^ Page Module:Citation/CS1/styles.css has no content.De Vito, Ernesto; Rosasco, Lorenzo; Caponnetto, Andrea; Piana, Michele; Verri, Alessandro (October 2004). "Some Properties of Regularized Kernel Methods". Journal of Machine Learning Research. 5: 1363–1390.
  12. ^ a b Page Module:Citation/CS1/styles.css has no content.Rasmussen, Carl Edward; Williams, Christopher K. I. (2006). Gaussian Processes for Machine Learning. The MIT Press. ISBN 0-262-18253-X.
  13. ^ Page Module:Citation/CS1/styles.css has no content.Huang, Yunfei.; et al. (2019). "Traction force microscopy with optimized regularization and automated Bayesian parameter selection for comparing cells". Scientific Reports. 9 (1) 539: 537. arXiv:1810.05848. Bibcode:2019NatSR...9..539H. doi:10.1038/s41598-018-36896-x. PMC 6345967. PMID 30679578.