Kernel embedding of distributions
In machine learning, the kernel embedding of distributions (also called the kernel mean or mean map) comprises a class of nonparametric methods in which a probability distribution is represented as an element of a reproducing kernel Hilbert space (RKHS).[1] A generalization of the individual data-point feature mapping done in classical kernel methods, the embedding of distributions into infinite-dimensional feature spaces can preserve all of the statistical features of arbitrary distributions, while allowing one to compare and manipulate distributions using Hilbert space operations such as inner products, distances, projections, linear transformations, and spectral analysis.[2] This learning framework is very general and can be applied to distributions over any space [math]\displaystyle{ \Omega }[/math] on which a sensible kernel function (measuring similarity between elements of [math]\displaystyle{ \Omega }[/math]) may be defined. For example, various kernels have been proposed for learning from data which are: vectors in [math]\displaystyle{ \mathbb{R}^d }[/math], discrete classes/categories, strings, graphs/networks, images, time series, manifolds, dynamical systems, and other structured objects.[3][4] The theory behind kernel embeddings of distributions has been primarily developed by Alex Smola, Le Song , Arthur Gretton, and Bernhard Schölkopf. A review of recent works on kernel embedding of distributions can be found in.[5]
The analysis of distributions is fundamental in machine learning and statistics, and many algorithms in these fields rely on information theoretic approaches such as entropy, mutual information, or Kullback–Leibler divergence. However, to estimate these quantities, one must first either perform density estimation, or employ sophisticated space-partitioning/bias-correction strategies which are typically infeasible for high-dimensional data.[6] Commonly, methods for modeling complex distributions rely on parametric assumptions that may be unfounded or computationally challenging (e.g. Gaussian mixture models), while nonparametric methods like kernel density estimation (Note: the smoothing kernels in this context have a different interpretation than the kernels discussed here) or characteristic function representation (via the Fourier transform of the distribution) break down in high-dimensional settings.[2]
Methods based on the kernel embedding of distributions sidestep these problems and also possess the following advantages:[6]
- Data may be modeled without restrictive assumptions about the form of the distributions and relationships between variables
- Intermediate density estimation is not needed
- Practitioners may specify the properties of a distribution most relevant for their problem (incorporating prior knowledge via choice of the kernel)
- If a characteristic kernel is used, then the embedding can uniquely preserve all information about a distribution, while thanks to the kernel trick, computations on the potentially infinite-dimensional RKHS can be implemented in practice as simple Gram matrix operations
- Dimensionality-independent rates of convergence for the empirical kernel mean (estimated using samples from the distribution) to the kernel embedding of the true underlying distribution can be proven.
- Learning algorithms based on this framework exhibit good generalization ability and finite sample convergence, while often being simpler and more effective than information theoretic methods
Thus, learning via the kernel embedding of distributions offers a principled drop-in replacement for information theoretic approaches and is a framework which not only subsumes many popular methods in machine learning and statistics as special cases, but also can lead to entirely new learning algorithms.
Definitions
Let [math]\displaystyle{ X }[/math] denote a random variable with domain [math]\displaystyle{ \Omega }[/math] and distribution [math]\displaystyle{ P }[/math]. Given a symmetric, positive-definite kernel [math]\displaystyle{ k:\Omega \times \Omega \rightarrow \mathbb{R} }[/math] the Moore–Aronszajn theorem asserts the existence of a unique RKHS [math]\displaystyle{ \mathcal{H} }[/math] on [math]\displaystyle{ \Omega }[/math] (a Hilbert space of functions [math]\displaystyle{ f: \Omega \to \R }[/math] equipped with an inner product [math]\displaystyle{ \langle \cdot, \cdot \rangle_\mathcal{H} }[/math] and a norm [math]\displaystyle{ \| \cdot \|_\mathcal{H} }[/math]) for which [math]\displaystyle{ k }[/math] is a reproducing kernel, i.e., in which the element [math]\displaystyle{ k(x,\cdot) }[/math] satisfies the reproducing property
- [math]\displaystyle{ \langle f, k(x,\cdot) \rangle_\mathcal{H} = f(x) \qquad \forall f \in \mathcal{H},\quad \forall x \in \Omega. }[/math]
One may alternatively consider [math]\displaystyle{ k(x,\cdot) }[/math] an implicit feature mapping [math]\displaystyle{ \varphi(x) }[/math] from [math]\displaystyle{ \Omega }[/math] to [math]\displaystyle{ \mathcal{H} }[/math] (which is therefore also called the feature space), so that [math]\displaystyle{ k(x, x') = \langle \varphi(x), \varphi(x')\rangle_\mathcal{H} }[/math] can be viewed as a measure of similarity between points [math]\displaystyle{ x, x' \in \Omega. }[/math] While the similarity measure is linear in the feature space, it may be highly nonlinear in the original space depending on the choice of kernel.
Kernel embedding
The kernel embedding of the distribution [math]\displaystyle{ P }[/math] in [math]\displaystyle{ \mathcal{H} }[/math] (also called the kernel mean or mean map) is given by:[1]
- [math]\displaystyle{ \mu_X := \mathbb{E} [k(X, \cdot) ] = \mathbb{E} [\varphi(X) ] = \int_\Omega \varphi(x) \ \mathrm{d}P(x) }[/math]
If [math]\displaystyle{ P }[/math] allows a square integrable density [math]\displaystyle{ p }[/math], then [math]\displaystyle{ \mu_X = \mathcal{E}_k p }[/math], where [math]\displaystyle{ \mathcal{E}_k }[/math] is the Hilbert–Schmidt integral operator. A kernel is characteristic if the mean embedding [math]\displaystyle{ \mu: \{\text{family of distributions over }\Omega \} \to \mathcal{H} }[/math] is injective.[7] Each distribution can thus be uniquely represented in the RKHS and all statistical features of distributions are preserved by the kernel embedding if a characteristic kernel is used.
Empirical kernel embedding
Given [math]\displaystyle{ n }[/math] training examples [math]\displaystyle{ \{x_1, \ldots, x_n\} }[/math] drawn independently and identically distributed (i.i.d.) from [math]\displaystyle{ P, }[/math] the kernel embedding of [math]\displaystyle{ P }[/math] can be empirically estimated as
- [math]\displaystyle{ \widehat{\mu}_X = \frac{1}{n} \sum_{i=1}^n \varphi(x_i) }[/math]
Joint distribution embedding
If [math]\displaystyle{ Y }[/math] denotes another random variable (for simplicity, assume the co-domain of [math]\displaystyle{ Y }[/math] is also [math]\displaystyle{ \Omega }[/math] with the same kernel [math]\displaystyle{ k }[/math] which satisfies [math]\displaystyle{ \langle \varphi(x) \otimes \varphi(y), \varphi(x') \otimes \varphi(y') \rangle = k(x,x') k(y,y') }[/math]), then the joint distribution [math]\displaystyle{ P(x,y)) }[/math] can be mapped into a tensor product feature space [math]\displaystyle{ \mathcal{H} \otimes \mathcal{H} }[/math] via [2]
- [math]\displaystyle{ \mathcal{C}_{XY} = \mathbb{E} [\varphi(X) \otimes \varphi(Y)] = \int_{\Omega \times \Omega} \varphi(x) \otimes \varphi(y) \ \mathrm{d} P(x,y) }[/math]
By the equivalence between a tensor and a linear map, this joint embedding may be interpreted as an uncentered cross-covariance operator [math]\displaystyle{ \mathcal{C}_{XY}: \mathcal{H} \to \mathcal{H} }[/math] from which the cross-covariance of functions [math]\displaystyle{ f,g \in \mathcal{H} }[/math] can be computed as [8]
- [math]\displaystyle{ \operatorname{Cov} (f(X), g(Y)) := \mathbb{E} [f(X) g(Y)] - \mathbb{E} [f(X)] \mathbb{E} [g(Y)]= \langle f , \mathcal{C}_{XY} g \rangle_{\mathcal{H}} = \langle f \otimes g , \mathcal{C}_{XY} \rangle_{\mathcal{H} \otimes \mathcal{H}} }[/math]
Given [math]\displaystyle{ n }[/math] pairs of training examples [math]\displaystyle{ \{(x_1, y_1), \dots, (x_n, y_n)\} }[/math] drawn i.i.d. from [math]\displaystyle{ P }[/math], we can also empirically estimate the joint distribution kernel embedding via
- [math]\displaystyle{ \widehat{\mathcal{C}}_{XY} = \frac{1}{n} \sum_{i=1}^n \varphi(x_i) \otimes \varphi(y_i) }[/math]
Conditional distribution embedding
Given a conditional distribution [math]\displaystyle{ P(y\mid x), }[/math] one can define the corresponding RKHS embedding as [2]
- [math]\displaystyle{ \mu_{Y \mid x} = \mathbb{E} [ \varphi(Y)\mid X ] = \int_\Omega \varphi(y) \ \mathrm{d}P(y \mid x) }[/math]
Note that the embedding of [math]\displaystyle{ P(y\mid x) }[/math] thus defines a family of points in the RKHS indexed by the values [math]\displaystyle{ x }[/math] taken by conditioning variable [math]\displaystyle{ X }[/math]. By fixing [math]\displaystyle{ X }[/math] to a particular value, we obtain a single element in [math]\displaystyle{ \mathcal{H} }[/math], and thus it is natural to define the operator
- [math]\displaystyle{ \begin{cases} \mathcal{C}_{Y\mid X}: \mathcal{H} \to \mathcal{H} \\ \mathcal{C}_{Y\mid X} = \mathcal{C}_{YX} \mathcal{C}_{XX}^{-1} \end{cases} }[/math]
which given the feature mapping of [math]\displaystyle{ x }[/math] outputs the conditional embedding of [math]\displaystyle{ Y }[/math] given [math]\displaystyle{ X = x. }[/math] Assuming that for all [math]\displaystyle{ g \in \mathcal{H}: \mathbb{E} [g(Y)\mid X] \in \mathcal{H}, }[/math] it can be shown that [8]
- [math]\displaystyle{ \mu_{Y \mid x} = \mathcal{C}_{Y \mid X} \varphi(x) }[/math]
This assumption is always true for finite domains with characteristic kernels, but may not necessarily hold for continuous domains.[2] Nevertheless, even in cases where the assumption fails, [math]\displaystyle{ \mathcal{C}_{Y \mid X} \varphi(x) }[/math] may still be used to approximate the conditional kernel embedding [math]\displaystyle{ \mu_{Y \mid x}, }[/math] and in practice, the inversion operator is replaced with a regularized version of itself [math]\displaystyle{ (\mathcal{C}_{XX} + \lambda \mathbf{I})^{-1} }[/math] (where [math]\displaystyle{ \mathbf{I} }[/math] denotes the identity matrix).
Given training examples [math]\displaystyle{ \{(x_1, y_1),\dots, (x_n, y_n)\}, }[/math] the empirical kernel conditional embedding operator may be estimated as [2]
- [math]\displaystyle{ \widehat{C}_{Y\mid X} = \boldsymbol{\Phi} (\mathbf{K} + \lambda \mathbf{I})^{-1} \boldsymbol{\Upsilon}^T }[/math]
where [math]\displaystyle{ \boldsymbol{\Phi} = \left(\varphi(y_1),\dots, \varphi(y_n)\right), \boldsymbol{\Upsilon} = \left(\varphi(x_1),\dots, \varphi(x_n)\right) }[/math] are implicitly formed feature matrices, [math]\displaystyle{ \mathbf{K} =\boldsymbol{\Upsilon}^T \boldsymbol{\Upsilon} }[/math] is the Gram matrix for samples of [math]\displaystyle{ X }[/math], and [math]\displaystyle{ \lambda }[/math] is a regularization parameter needed to avoid overfitting.
Thus, the empirical estimate of the kernel conditional embedding is given by a weighted sum of samples of [math]\displaystyle{ Y }[/math] in the feature space:
- [math]\displaystyle{ \widehat{\mu}_{Y\mid x} = \sum_{i=1}^n \beta_i (x) \varphi(y_i) = \boldsymbol{\Phi} \boldsymbol{\beta}(x) }[/math]
where [math]\displaystyle{ \boldsymbol{\beta}(x) = (\mathbf{K} + \lambda \mathbf{I})^{-1} \mathbf{K}_x }[/math] and [math]\displaystyle{ \mathbf{K}_x = \left( k(x_1, x), \dots, k(x_n, x) \right)^T }[/math]
Properties
- The expectation of any function [math]\displaystyle{ f }[/math] in the RKHS can be computed as an inner product with the kernel embedding:
- [math]\displaystyle{ \mathbb{E} [f(X)] = \langle f, \mu_X \rangle_\mathcal{H} }[/math]
- In the presence of large sample sizes, manipulations of the [math]\displaystyle{ n \times n }[/math] Gram matrix may be computationally demanding. Through use of a low-rank approximation of the Gram matrix (such as the incomplete Cholesky factorization), running time and memory requirements of kernel-embedding-based learning algorithms can be drastically reduced without suffering much loss in approximation accuracy.[2]
Convergence of empirical kernel mean to the true distribution embedding
- If [math]\displaystyle{ k }[/math] is defined such that [math]\displaystyle{ f }[/math] takes values in [math]\displaystyle{ [0,1] }[/math] for all [math]\displaystyle{ f \in \mathcal{H} }[/math] with [math]\displaystyle{ \| f\|_\mathcal{H} \le 1 }[/math] (as is the case for the widely used radial basis function kernels), then with probability at least [math]\displaystyle{ 1-\delta }[/math]:[6]
- [math]\displaystyle{ \|\mu_X - \widehat{\mu}_X \|_\mathcal{H} = \sup_{f \in \mathcal{B}(0,1)} \left| \mathbb{E} [f(X)] - \frac{1}{n} \sum_{i=1}^n f(x_i) \right| \le \frac{2}{n} \mathbb{E} \left[ \sqrt{\operatorname{tr} K} \right] + \sqrt{\frac{\log (2/\delta)}{2n}} }[/math]
- where [math]\displaystyle{ \mathcal{B}(0,1) }[/math] denotes the unit ball in [math]\displaystyle{ \mathcal{H} }[/math] and [math]\displaystyle{ \mathbf{K} =(k_{ij}) }[/math] is the Gram matrix with [math]\displaystyle{ k_{ij} = k(x_i, x_j). }[/math]
- The rate of convergence (in RKHS norm) of the empirical kernel embedding to its distribution counterpart is [math]\displaystyle{ O(n^{-1/2}) }[/math] and does not depend on the dimension of [math]\displaystyle{ X }[/math].
- Statistics based on kernel embeddings thus avoid the curse of dimensionality, and though the true underlying distribution is unknown in practice, one can (with high probability) obtain an approximation within [math]\displaystyle{ O(n^{-1/2}) }[/math] of the true kernel embedding based on a finite sample of size [math]\displaystyle{ n }[/math].
- For the embedding of conditional distributions, the empirical estimate can be seen as a weighted average of feature mappings (where the weights [math]\displaystyle{ \beta_i(x) }[/math] depend on the value of the conditioning variable and capture the effect of the conditioning on the kernel embedding). In this case, the empirical estimate converges to the conditional distribution RKHS embedding with rate [math]\displaystyle{ O\left(n^{-1/4} \right) }[/math] if the regularization parameter [math]\displaystyle{ \lambda }[/math] is decreased as [math]\displaystyle{ O\left( n^{-1/2} \right), }[/math] though faster rates of convergence may be achieved by placing additional assumptions on the joint distribution.[2]
Universal kernels
- Let [math]\displaystyle{ \mathcal{X} }[/math] be a compact metric space and [math]\displaystyle{ C(\mathcal{X}) }[/math] the set of continuous functions. The reproducing kernel [math]\displaystyle{ k:\mathcal{X}\times \mathcal{X} \rightarrow \mathbb{R} }[/math] is called universal if and only if the RKHS [math]\displaystyle{ \mathcal{H} }[/math] of [math]\displaystyle{ k }[/math] is dense in [math]\displaystyle{ C(\mathcal{X}) }[/math], i.e., for any [math]\displaystyle{ g \in C(\mathcal{X}) }[/math] and all [math]\displaystyle{ \varepsilon \gt 0 }[/math] there exists an [math]\displaystyle{ f \in \mathcal{H} }[/math] such that [math]\displaystyle{ \| f-g\|_{\infty} \leq \varepsilon }[/math].[9] All universal kernels defined on a compact space are characteristic kernels but the converse is not always true.[10]
- Let [math]\displaystyle{ k }[/math] be a continuous translation invariant kernel [math]\displaystyle{ k(x, x') = h(x-x') }[/math] with [math]\displaystyle{ x \in \mathbb{R}^{b} }[/math]. Then Bochner's theorem guarantees the existence of a unique finite Borel measure [math]\displaystyle{ \mu }[/math] (called the spectral measure) on [math]\displaystyle{ \mathbb{R}^{b} }[/math] such that
- [math]\displaystyle{ h(t) = \int_{\mathbb{R}^{b}} e^{-i\langle t, \omega \rangle} d\mu(\omega), \quad \forall t \in \mathbb{R}^{b}. }[/math]
- For [math]\displaystyle{ k }[/math] to be universal it suffices that the continuous part of [math]\displaystyle{ \mu }[/math] in its unique Lebesgue decomposition [math]\displaystyle{ \mu = \mu_c + \mu_s }[/math] is non-zero. Furthermore, if
- [math]\displaystyle{ d\mu_c(\omega) = s(\omega)d\omega, }[/math]
- then [math]\displaystyle{ s }[/math] is the spectral density of frequencies [math]\displaystyle{ \omega }[/math] in [math]\displaystyle{ \mathbb{R}^{b} }[/math] and [math]\displaystyle{ h }[/math] is the Fourier transform of [math]\displaystyle{ s }[/math]. If the support of [math]\displaystyle{ \mu }[/math] is all of [math]\displaystyle{ \mathbb{R}^{b} }[/math], then [math]\displaystyle{ k }[/math] is a characteristic kernel as well.[11][12][13]
- If [math]\displaystyle{ k }[/math] induces a strictly positive definite kernel matrix for any set of distinct points, then it is a universal kernel.[6] For example, the widely used Gaussian RBF kernel
- [math]\displaystyle{ k(x,x') = \exp\left(-\frac{1}{2\sigma^2} \|x-x'\|^2 \right) }[/math]
- on compact subsets of [math]\displaystyle{ \mathbb{R}^d }[/math] is universal.
Parameter selection for conditional distribution kernel embeddings
- The empirical kernel conditional distribution embedding operator [math]\displaystyle{ \widehat{\mathcal{C}}_{Y|X} }[/math] can alternatively be viewed as the solution of the following regularized least squares (function-valued) regression problem [14]
- [math]\displaystyle{ \min_{\mathcal{C}: \mathcal{H} \to \mathcal{H}} \sum_{i=1}^n \left \|\varphi(y_i)-\mathcal{C} \varphi(x_i) \right \|_\mathcal{H}^2 + \lambda \|\mathcal{C} \|_{HS}^2 }[/math]
- where [math]\displaystyle{ \|\cdot\|_{HS} }[/math] is the Hilbert–Schmidt norm.
- One can thus select the regularization parameter [math]\displaystyle{ \lambda }[/math] by performing cross-validation based on the squared loss function of the regression problem.
Rules of probability as operations in the RKHS
This section illustrates how basic probabilistic rules may be reformulated as (multi)linear algebraic operations in the kernel embedding framework and is primarily based on the work of Song et al.[2][8] The following notation is adopted:
- [math]\displaystyle{ P(X,Y)= }[/math] joint distribution over random variables [math]\displaystyle{ X, Y }[/math]
- [math]\displaystyle{ P(X)= \int_\Omega P(X, \mathrm{d}y) = }[/math] marginal distribution of [math]\displaystyle{ X }[/math]; [math]\displaystyle{ P(Y)= }[/math] marginal distribution of [math]\displaystyle{ Y }[/math]
- [math]\displaystyle{ P(Y \mid X) = \frac{P(X,Y)}{P(X)} = }[/math] conditional distribution of [math]\displaystyle{ Y }[/math] given [math]\displaystyle{ X }[/math] with corresponding conditional embedding operator [math]\displaystyle{ \mathcal{C}_{Y \mid X} }[/math]
- [math]\displaystyle{ \pi(Y) = }[/math] prior distribution over [math]\displaystyle{ Y }[/math]
- [math]\displaystyle{ Q }[/math] is used to distinguish distributions which incorporate the prior from distributions [math]\displaystyle{ P }[/math] which do not rely on the prior
In practice, all embeddings are empirically estimated from data [math]\displaystyle{ \{(x_1,y_1),\dots, (x_n, y_n)\} }[/math] and it assumed that a set of samples [math]\displaystyle{ \{\widetilde{y}_1, \ldots, \widetilde{y}_{\widetilde{n}} \} }[/math] may be used to estimate the kernel embedding of the prior distribution [math]\displaystyle{ \pi(Y) }[/math].
Kernel sum rule
In probability theory, the marginal distribution of [math]\displaystyle{ X }[/math] can be computed by integrating out [math]\displaystyle{ Y }[/math] from the joint density (including the prior distribution on [math]\displaystyle{ Y }[/math])
- [math]\displaystyle{ Q(X) = \int_\Omega P(X \mid Y) \, \mathrm{d} \pi(Y) }[/math]
The analog of this rule in the kernel embedding framework states that [math]\displaystyle{ \mu_X^\pi, }[/math] the RKHS embedding of [math]\displaystyle{ Q(X) }[/math], can be computed via
- [math]\displaystyle{ \mu_X^\pi = \mathbb{E} [\mathcal{C}_{X \mid Y} \varphi(Y) ] = \mathcal{C}_{X\mid Y} \mathbb{E} [\varphi(Y)] = \mathcal{C}_{X\mid Y} \mu_Y^\pi }[/math]
where [math]\displaystyle{ \mu_Y^\pi }[/math] is the kernel embedding of [math]\displaystyle{ \pi(Y). }[/math] In practical implementations, the kernel sum rule takes the following form
- [math]\displaystyle{ \widehat{\mu}_X^\pi = \widehat{\mathcal{C}}_{X \mid Y} \widehat{\mu}_Y^\pi = \boldsymbol{\Upsilon} (\mathbf{G} + \lambda \mathbf{I})^{-1} \widetilde{\mathbf{G}} \boldsymbol{\alpha} }[/math]
where
- [math]\displaystyle{ \mu_Y^\pi = \sum_{i=1}^{\widetilde{n}} \alpha_i \varphi(\widetilde{y}_i) }[/math]
is the empirical kernel embedding of the prior distribution, [math]\displaystyle{ \boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_{\widetilde{n}} )^T, }[/math] [math]\displaystyle{ \boldsymbol{\Upsilon} = \left(\varphi(x_1), \ldots, \varphi(x_n) \right) }[/math], and [math]\displaystyle{ \mathbf{G}, \widetilde{\mathbf{G}} }[/math] are Gram matrices with entries [math]\displaystyle{ \mathbf{G}_{ij} = k(y_i, y_j), \widetilde{\mathbf{G}}_{ij} = k(y_i, \widetilde{y}_j) }[/math] respectively.
Kernel chain rule
In probability theory, a joint distribution can be factorized into a product between conditional and marginal distributions
- [math]\displaystyle{ Q(X,Y) = P(X \mid Y) \pi(Y) }[/math]
The analog of this rule in the kernel embedding framework states that [math]\displaystyle{ \mathcal{C}_{XY}^\pi, }[/math] the joint embedding of [math]\displaystyle{ Q(X,Y), }[/math] can be factorized as a composition of conditional embedding operator with the auto-covariance operator associated with [math]\displaystyle{ \pi(Y) }[/math]
- [math]\displaystyle{ \mathcal{C}_{XY}^\pi = \mathcal{C}_{X \mid Y} \mathcal{C}_{YY}^\pi }[/math]
where
- [math]\displaystyle{ \mathcal{C}_{XY}^\pi = \mathbb{E} [\varphi(X) \otimes \varphi(Y) ], }[/math]
- [math]\displaystyle{ \mathcal{C}_{YY}^\pi = \mathbb{E} [\varphi(Y) \otimes \varphi(Y)]. }[/math]
In practical implementations, the kernel chain rule takes the following form
- [math]\displaystyle{ \widehat{\mathcal{C}}_{XY}^\pi = \widehat{\mathcal{C}}_{X \mid Y} \widehat{\mathcal{C}}_{YY}^\pi = \boldsymbol{\Upsilon} (\mathbf{G} + \lambda \mathbf{I})^{-1} \widetilde{\mathbf{G}} \operatorname{diag}(\boldsymbol{\alpha}) \boldsymbol{\widetilde{\Phi}}^T }[/math]
Kernel Bayes' rule
In probability theory, a posterior distribution can be expressed in terms of a prior distribution and a likelihood function as
- [math]\displaystyle{ Q(Y\mid x) = \frac{P(x\mid Y) \pi(Y)}{Q(x)} }[/math] where [math]\displaystyle{ Q(x) = \int_\Omega P(x \mid y) \, \mathrm{d} \pi(y) }[/math]
The analog of this rule in the kernel embedding framework expresses the kernel embedding of the conditional distribution in terms of conditional embedding operators which are modified by the prior distribution
- [math]\displaystyle{ \mu_{Y\mid x}^\pi = \mathcal{C}_{Y \mid X}^\pi \varphi(x) = \mathcal{C}_{YX}^\pi \left ( \mathcal{C}_{XX}^\pi \right )^{-1} \varphi(x) }[/math]
where from the chain rule:
- [math]\displaystyle{ \mathcal{C}_{YX}^\pi = \left( \mathcal{C}_{X\mid Y} \mathcal{C}_{YY}^\pi \right)^T. }[/math]
In practical implementations, the kernel Bayes' rule takes the following form
- [math]\displaystyle{ \widehat{\mu}_{Y\mid x}^\pi = \widehat{\mathcal{C}}_{YX}^\pi \left( \left (\widehat{\mathcal{C}}_{XX} \right )^2 + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widehat{\mathcal{C}}_{XX}^\pi \varphi(x) = \widetilde{\boldsymbol{\Phi}} \boldsymbol{\Lambda}^T \left( (\mathbf{D} \mathbf{K})^2 + \widetilde{\lambda} \mathbf{I} \right)^{-1} \mathbf{K} \mathbf{D} \mathbf{K}_x }[/math]
where
- [math]\displaystyle{ \boldsymbol{\Lambda} = \left(\mathbf{G} + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widetilde{\mathbf{G}} \operatorname{diag}(\boldsymbol{\alpha}), \qquad \mathbf{D} = \operatorname{diag}\left(\left(\mathbf{G} + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widetilde{\mathbf{G}} \boldsymbol{\alpha} \right). }[/math]
Two regularization parameters are used in this framework: [math]\displaystyle{ \lambda }[/math] for the estimation of [math]\displaystyle{ \widehat{\mathcal{C}}_{YX}^\pi, \widehat{\mathcal{C}}_{XX}^\pi = \boldsymbol{\Upsilon} \mathbf{D} \boldsymbol{\Upsilon}^T }[/math] and [math]\displaystyle{ \widetilde{\lambda} }[/math] for the estimation of the final conditional embedding operator
- [math]\displaystyle{ \widehat{\mathcal{C}}_{Y\mid X}^\pi = \widehat{\mathcal{C}}_{YX}^\pi \left( \left (\widehat{\mathcal{C}}_{XX}^\pi \right )^2 + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widehat{\mathcal{C}}_{XX}^\pi. }[/math]
The latter regularization is done on square of [math]\displaystyle{ \widehat{\mathcal{C}}_{XX}^\pi }[/math] because [math]\displaystyle{ D }[/math] may not be positive definite.
Applications
Measuring distance between distributions
The maximum mean discrepancy (MMD) is a distance-measure between distributions [math]\displaystyle{ P(X) }[/math] and [math]\displaystyle{ Q(Y) }[/math] which is defined as the distance between their embeddings in the RKHS [6]
- [math]\displaystyle{ \text{MMD}(P,Q) = \left \| \mu_X - \mu_Y \right \|_{\mathcal{H}} . }[/math]
While most distance-measures between distributions such as the widely used Kullback–Leibler divergence either require density estimation (either parametrically or nonparametrically) or space partitioning/bias correction strategies,[6] the MMD is easily estimated as an empirical mean which is concentrated around the true value of the MMD. The characterization of this distance as the maximum mean discrepancy refers to the fact that computing the MMD is equivalent to finding the RKHS function that maximizes the difference in expectations between the two probability distributions
- [math]\displaystyle{ \text{MMD}(P,Q) = \sup_{\|f \|_\mathcal{H} \le 1} \left( \mathbb{E} [f(X)] - \mathbb{E} [f(Y)] \right), }[/math]
a form of integral probability metric.
Kernel two-sample test
Given n training examples from [math]\displaystyle{ P(X) }[/math] and m samples from [math]\displaystyle{ Q(Y) }[/math], one can formulate a test statistic based on the empirical estimate of the MMD
- [math]\displaystyle{ \begin{align} \widehat{\text{MMD}}(P,Q) & = \left\| \frac{1}{n}\sum_{i=1}^n \varphi(x_i) - \frac{1}{m}\sum_{i=1}^m \varphi(y_i) \right \|_{\mathcal{H}}^2 \\[5pt] & = \frac{1}{n^2} \sum_{i=1}^n\sum_{j=1}^n k(x_i, x_j) + \frac{1}{m^2} \sum_{i=1}^m\sum_{j=1}^m k(y_i, y_j) - \frac{2}{nm} \sum_{i=1}^n\sum_{j=1}^m k(x_i, y_j) \end{align} }[/math]
to obtain a two-sample test [15] of the null hypothesis that both samples stem from the same distribution (i.e. [math]\displaystyle{ P = Q }[/math]) against the broad alternative [math]\displaystyle{ P \neq Q }[/math].
Density estimation via kernel embeddings
Although learning algorithms in the kernel embedding framework circumvent the need for intermediate density estimation, one may nonetheless use the empirical embedding to perform density estimation based on n samples drawn from an underlying distribution [math]\displaystyle{ P_X^* }[/math]. This can be done by solving the following optimization problem [6][16]
- [math]\displaystyle{ \max_{P_X} H(P_X) }[/math] subject to [math]\displaystyle{ \|\widehat{\mu}_X - \mu_X[P_X] \|_\mathcal{H} \le \varepsilon }[/math]
where the maximization is done over the entire space of distributions on [math]\displaystyle{ \Omega. }[/math] Here, [math]\displaystyle{ \mu_X[P_X] }[/math] is the kernel embedding of the proposed density [math]\displaystyle{ P_X }[/math] and [math]\displaystyle{ H }[/math] is an entropy-like quantity (e.g. Entropy, KL divergence, Bregman divergence). The distribution which solves this optimization may be interpreted as a compromise between fitting the empirical kernel means of the samples well, while still allocating a substantial portion of the probability mass to all regions of the probability space (much of which may not be represented in the training examples). In practice, a good approximate solution of the difficult optimization may be found by restricting the space of candidate densities to a mixture of M candidate distributions with regularized mixing proportions. Connections between the ideas underlying Gaussian processes and conditional random fields may be drawn with the estimation of conditional probability distributions in this fashion, if one views the feature mappings associated with the kernel as sufficient statistics in generalized (possibly infinite-dimensional) exponential families.[6]
Measuring dependence of random variables
A measure of the statistical dependence between random variables [math]\displaystyle{ X }[/math] and [math]\displaystyle{ Y }[/math] (from any domains on which sensible kernels can be defined) can be formulated based on the Hilbert–Schmidt Independence Criterion [17]
- [math]\displaystyle{ \text{HSIC}(X, Y) = \left \| \mathcal{C}_{XY} - \mu_X \otimes \mu_Y \right \|_{\mathcal{H} \otimes \mathcal{H}}^2 }[/math]
and can be used as a principled replacement for mutual information, Pearson correlation or any other dependence measure used in learning algorithms. Most notably, HSIC can detect arbitrary dependencies (when a characteristic kernel is used in the embeddings, HSIC is zero if and only if the variables are independent), and can be used to measure dependence between different types of data (e.g. images and text captions). Given n i.i.d. samples of each random variable, a simple parameter-free unbiased estimator of HSIC which exhibits concentration about the true value can be computed in [math]\displaystyle{ O(n(d_f^2 +d_g^2)) }[/math] time,[6] where the Gram matrices of the two datasets are approximated using [math]\displaystyle{ \mathbf{A} \mathbf{A}^T, \mathbf{B} \mathbf{B}^T }[/math] with [math]\displaystyle{ \mathbf{A} \in \R^{n \times d_f}, \mathbf{B} \in \R^{n \times d_g} }[/math]. The desirable properties of HSIC have led to the formulation of numerous algorithms which utilize this dependence measure for a variety of common machine learning tasks such as: feature selection (BAHSIC [18]), clustering (CLUHSIC [19]), and dimensionality reduction (MUHSIC [20]).
HSIC can be extended to measure the dependence of multiple random variables. The question of when HSIC captures independence in this case has recently been studied:[21] for more than two variables
- on [math]\displaystyle{ \R^d }[/math]: the characteristic property of the individual kernels remains an equivalent condition.
- on general domains: the characteristic property of the kernel components is necessary but not sufficient.
Kernel belief propagation
Belief propagation is a fundamental algorithm for inference in graphical models in which nodes repeatedly pass and receive messages corresponding to the evaluation of conditional expectations. In the kernel embedding framework, the messages may be represented as RKHS functions and the conditional distribution embeddings can be applied to efficiently compute message updates. Given n samples of random variables represented by nodes in a Markov random field, the incoming message to node t from node u can be expressed as
- [math]\displaystyle{ m_{ut}(\cdot) = \sum_{i=1}^n \beta_{ut}^i \varphi(x_t^i) }[/math]
if it assumed to lie in the RKHS. The kernel belief propagation update message from t to node s is then given by [2]
- [math]\displaystyle{ \widehat{m}_{ts} = \left( \odot_{u \in N(t) \backslash s} \mathbf{K}_t \boldsymbol{\beta}_{ut} \right)^T (\mathbf{K}_s + \lambda \mathbf{I} )^{-1} \boldsymbol{\Upsilon}_s^T \varphi(x_s) }[/math]
where [math]\displaystyle{ \odot }[/math] denotes the element-wise vector product, [math]\displaystyle{ N(t) \backslash s }[/math] is the set of nodes connected to t excluding node s, [math]\displaystyle{ \boldsymbol{\beta}_{ut} = \left(\beta_{ut}^1, \dots, \beta_{ut}^n \right) }[/math], [math]\displaystyle{ \mathbf{K}_t, \mathbf{K}_s }[/math] are the Gram matrices of the samples from variables [math]\displaystyle{ X_t, X_s }[/math], respectively, and [math]\displaystyle{ \boldsymbol{\Upsilon}_s = \left(\varphi(x_s^1),\dots, \varphi(x_s^n)\right) }[/math] is the feature matrix for the samples from [math]\displaystyle{ X_s }[/math].
Thus, if the incoming messages to node t are linear combinations of feature mapped samples from [math]\displaystyle{ X_t }[/math], then the outgoing message from this node is also a linear combination of feature mapped samples from [math]\displaystyle{ X_s }[/math]. This RKHS function representation of message-passing updates therefore produces an efficient belief propagation algorithm in which the potentials are nonparametric functions inferred from the data so that arbitrary statistical relationships may be modeled.[2]
In the hidden Markov model (HMM), two key quantities of interest are the transition probabilities between hidden states [math]\displaystyle{ P(S^t \mid S^{t-1}) }[/math] and the emission probabilities [math]\displaystyle{ P(O^t \mid S^t) }[/math] for observations. Using the kernel conditional distribution embedding framework, these quantities may be expressed in terms of samples from the HMM. A serious limitation of the embedding methods in this domain is the need for training samples containing hidden states, as otherwise inference with arbitrary distributions in the HMM is not possible.
One common use of HMMs is filtering in which the goal is to estimate posterior distribution over the hidden state [math]\displaystyle{ s^t }[/math] at time step t given a history of previous observations [math]\displaystyle{ h^t = (o^1, \dots, o^t) }[/math] from the system. In filtering, a belief state [math]\displaystyle{ P(S^{t+1} \mid h^{t+1}) }[/math] is recursively maintained via a prediction step (where updates [math]\displaystyle{ P(S^{t+1} \mid h^t) = \mathbb{E}[P(S^{t+1} \mid S^t) \mid h^t] }[/math] are computed by marginalizing out the previous hidden state) followed by a conditioning step (where updates [math]\displaystyle{ P(S^{t+1} \mid h^t, o^{t+1}) \propto P(o^{t+1} \mid S^{t+1}) P(S^{t+1} \mid h^t) }[/math] are computed by applying Bayes' rule to condition on a new observation).[2] The RKHS embedding of the belief state at time t+1 can be recursively expressed as
- [math]\displaystyle{ \mu_{S^{t+1} \mid h^{t+1}} = \mathcal{C}_{S^{t+1} O^{t+1}}^\pi \left(\mathcal{C}_{O^{t+1} O^{t+1}}^\pi \right)^{-1} \varphi(o^{t+1}) }[/math]
by computing the embeddings of the prediction step via the kernel sum rule and the embedding of the conditioning step via kernel Bayes' rule. Assuming a training sample [math]\displaystyle{ (\widetilde{s}^1, \dots, \widetilde{s}^T, \widetilde{o}^1, \dots, \widetilde{o}^T) }[/math] is given, one can in practice estimate
- [math]\displaystyle{ \widehat{\mu}_{S^{t+1} \mid h^{t+1}} = \sum_{i=1}^T \alpha_i^t \varphi(\widetilde{s}^t) }[/math]
and filtering with kernel embeddings is thus implemented recursively using the following updates for the weights [math]\displaystyle{ \boldsymbol{\alpha} = (\alpha_1, \dots, \alpha_T) }[/math] [2]
- [math]\displaystyle{ \mathbf{D}^{t+1} = \operatorname{diag}\left((G+\lambda \mathbf{I})^{-1} \widetilde{G} \boldsymbol{\alpha}^t \right) }[/math]
- [math]\displaystyle{ \boldsymbol{\alpha}^{t+1} = \mathbf{D}^{t+1} \mathbf{K} \left( (\mathbf{D}^{t+1} K)^2 + \widetilde{\lambda} \mathbf{I} \right)^{-1} \mathbf{D}^{t+1} \mathbf{K}_{o^{t+1}} }[/math]
where [math]\displaystyle{ \mathbf{G}, \mathbf{K} }[/math] denote the Gram matrices of [math]\displaystyle{ \widetilde{s}^1, \dots, \widetilde{s}^T }[/math] and [math]\displaystyle{ \widetilde{o}^1, \dots, \widetilde{o}^T }[/math] respectively, [math]\displaystyle{ \widetilde{\mathbf{G}} }[/math] is a transfer Gram matrix defined as [math]\displaystyle{ \widetilde{\mathbf{G}}_{ij} = k(\widetilde{s}_i, \widetilde{s}_{j+1}), }[/math] and [math]\displaystyle{ \mathbf{K}_{o^{t+1}} = (k(\widetilde{o}^1, o^{t+1}), \dots, k(\widetilde{o}^T, o^{t+1}))^T. }[/math]
Support measure machines
The support measure machine (SMM) is a generalization of the support vector machine (SVM) in which the training examples are probability distributions paired with labels [math]\displaystyle{ \{P_i, y_i\}_{i=1}^n, \ y_i \in \{+1, -1\} }[/math].[22] SMMs solve the standard SVM dual optimization problem using the following expected kernel
- [math]\displaystyle{ K\left(P(X), Q(Z)\right) = \langle \mu_X , \mu_Z \rangle_\mathcal{H} = \mathbb{E} [k(x,z)] }[/math]
which is computable in closed form for many common specific distributions [math]\displaystyle{ P_i }[/math] (such as the Gaussian distribution) combined with popular embedding kernels [math]\displaystyle{ k }[/math] (e.g. the Gaussian kernel or polynomial kernel), or can be accurately empirically estimated from i.i.d. samples [math]\displaystyle{ \{x_i\}_{i=1}^n \sim P(X), \{z_j\}_{j=1}^m \sim Q(Z) }[/math] via
- [math]\displaystyle{ \widehat{K} (X, Z) = \frac{1}{n m} \sum_{i=1}^n \sum_{j=1}^m k(x_i, z_j) }[/math]
Under certain choices of the embedding kernel [math]\displaystyle{ k }[/math], the SMM applied to training examples [math]\displaystyle{ \{P_i, y_i\}_{i=1}^n }[/math] is equivalent to a SVM trained on samples [math]\displaystyle{ \{x_i, y_i\}_{i=1}^n }[/math], and thus the SMM can be viewed as a flexible SVM in which a different data-dependent kernel (specified by the assumed form of the distribution [math]\displaystyle{ P_i }[/math]) may be placed on each training point.[22]
Domain adaptation under covariate, target, and conditional shift
The goal of domain adaptation is the formulation of learning algorithms which generalize well when the training and test data have different distributions. Given training examples [math]\displaystyle{ \{(x_i^\text{tr}, y_i^\text{tr})\}_{i=1}^n }[/math] and a test set [math]\displaystyle{ \{(x_j^\text{te}, y_j^\text{te}) \}_{j=1}^m }[/math] where the [math]\displaystyle{ y_j^\text{te} }[/math] are unknown, three types of differences are commonly assumed between the distribution of the training examples [math]\displaystyle{ P^\text{tr}(X,Y) }[/math] and the test distribution [math]\displaystyle{ P^\text{te}(X,Y) }[/math]:[23][24]
- Covariate shift in which the marginal distribution of the covariates changes across domains: [math]\displaystyle{ P^\text{tr}(X) \neq P^\text{te}(X) }[/math]
- Target shift in which the marginal distribution of the outputs changes across domains: [math]\displaystyle{ P^\text{tr}(Y) \neq P^\text{te}(Y) }[/math]
- Conditional shift in which [math]\displaystyle{ P(Y) }[/math] remains the same across domains, but the conditional distributions differ: [math]\displaystyle{ P^\text{tr}(X \mid Y) \neq P^\text{te}(X \mid Y) }[/math]. In general, the presence of conditional shift leads to an ill-posed problem, and the additional assumption that [math]\displaystyle{ P(X \mid Y) }[/math] changes only under location-scale (LS) transformations on [math]\displaystyle{ X }[/math] is commonly imposed to make the problem tractable.
By utilizing the kernel embedding of marginal and conditional distributions, practical approaches to deal with the presence of these types of differences between training and test domains can be formulated. Covariate shift may be accounted for by reweighting examples via estimates of the ratio [math]\displaystyle{ P^\text{te}(X)/P^\text{tr}(X) }[/math] obtained directly from the kernel embeddings of the marginal distributions of [math]\displaystyle{ X }[/math] in each domain without any need for explicit estimation of the distributions.[24] Target shift, which cannot be similarly dealt with since no samples from [math]\displaystyle{ Y }[/math] are available in the test domain, is accounted for by weighting training examples using the vector [math]\displaystyle{ \boldsymbol{\beta}^*(\mathbf{y}^\text{tr}) }[/math] which solves the following optimization problem (where in practice, empirical approximations must be used) [23]
- [math]\displaystyle{ \min_{\boldsymbol{\beta}(y)} \left \|\mathcal{C}_{{(X \mid Y)}^\text{tr}} \mathbb{E} [\boldsymbol{\beta}(y) \varphi(y^\text{tr})] - \mu_{X^\text{te}} \right \|_\mathcal{H}^2 }[/math] subject to [math]\displaystyle{ \boldsymbol{\beta}(y) \ge 0, \mathbb{E} [\boldsymbol{\beta}(y^\text{tr})] = 1 }[/math]
To deal with location scale conditional shift, one can perform a LS transformation of the training points to obtain new transformed training data [math]\displaystyle{ \mathbf{X}^\text{new} = \mathbf{X}^\text{tr} \odot \mathbf{W} + \mathbf{B} }[/math] (where [math]\displaystyle{ \odot }[/math] denotes the element-wise vector product). To ensure similar distributions between the new transformed training samples and the test data, [math]\displaystyle{ \mathbf{W},\mathbf{B} }[/math] are estimated by minimizing the following empirical kernel embedding distance [23]
- [math]\displaystyle{ \left \| \widehat{\mu}_{X^\text{new}} - \widehat{\mu}_{X^\text{te}} \right \|_{\mathcal{H}}^2 = \left \| \widehat{\mathcal{C}}_{(X \mid Y)^\text{new}} \widehat{\mu}_{Y^\text{tr}} - \widehat{\mu}_{X^\text{te}} \right \|_{\mathcal{H}}^2 }[/math]
In general, the kernel embedding methods for dealing with LS conditional shift and target shift may be combined to find a reweighted transformation of the training data which mimics the test distribution, and these methods may perform well even in the presence of conditional shifts other than location-scale changes.[23]
Domain generalization via invariant feature representation
Given N sets of training examples sampled i.i.d. from distributions [math]\displaystyle{ P^{(1)}(X,Y), P^{(2)}(X,Y), \ldots, P^{(N)}(X,Y) }[/math], the goal of domain generalization is to formulate learning algorithms which perform well on test examples sampled from a previously unseen domain [math]\displaystyle{ P^*(X,Y) }[/math] where no data from the test domain is available at training time. If conditional distributions [math]\displaystyle{ P(Y \mid X) }[/math] are assumed to be relatively similar across all domains, then a learner capable of domain generalization must estimate a functional relationship between the variables which is robust to changes in the marginals [math]\displaystyle{ P(X) }[/math]. Based on kernel embeddings of these distributions, Domain Invariant Component Analysis (DICA) is a method which determines the transformation of the training data that minimizes the difference between marginal distributions while preserving a common conditional distribution shared between all training domains.[25] DICA thus extracts invariants, features that transfer across domains, and may be viewed as a generalization of many popular dimension-reduction methods such as kernel principal component analysis, transfer component analysis, and covariance operator inverse regression.[25]
Defining a probability distribution [math]\displaystyle{ \mathcal{P} }[/math] on the RKHS [math]\displaystyle{ \mathcal{H} }[/math] with
- [math]\displaystyle{ \mathcal{P} \left (\mu_{X^{(i)}Y^{(i)}} \right ) = \frac{1}{N} \qquad \text{ for } i=1,\dots, N, }[/math]
DICA measures dissimilarity between domains via distributional variance which is computed as
- [math]\displaystyle{ V_\mathcal{H} (\mathcal{P}) = \frac{1}{N} \operatorname{tr}(\mathbf{G}) - \frac{1}{N^2} \sum_{i,j=1}^N \mathbf{G}_{ij} }[/math]
where
- [math]\displaystyle{ \mathbf{G}_{ij} = \left \langle \mu_{X^{(i)}}, \mu_{X^{(j)}} \right \rangle_\mathcal{H} }[/math]
so [math]\displaystyle{ \mathbf{G} }[/math] is a [math]\displaystyle{ N \times N }[/math] Gram matrix over the distributions from which the training data are sampled. Finding an orthogonal transform onto a low-dimensional subspace B (in the feature space) which minimizes the distributional variance, DICA simultaneously ensures that B aligns with the bases of a central subspace C for which [math]\displaystyle{ Y }[/math] becomes independent of [math]\displaystyle{ X }[/math] given [math]\displaystyle{ C^T X }[/math] across all domains. In the absence of target values [math]\displaystyle{ Y }[/math], an unsupervised version of DICA may be formulated which finds a low-dimensional subspace that minimizes distributional variance while simultaneously maximizing the variance of [math]\displaystyle{ X }[/math] (in the feature space) across all domains (rather than preserving a central subspace).[25]
Distribution regression
In distribution regression, the goal is to regress from probability distributions to reals (or vectors). Many important machine learning and statistical tasks fit into this framework, including multi-instance learning, and point estimation problems without analytical solution (such as hyperparameter or entropy estimation). In practice only samples from sampled distributions are observable, and the estimates have to rely on similarities computed between sets of points. Distribution regression has been successfully applied for example in supervised entropy learning, and aerosol prediction using multispectral satellite images.[26]
Given [math]\displaystyle{ {\left(\{X_{i,n}\}_{n=1}^{N_i}, y_i\right)}_{i=1}^\ell }[/math] training data, where the [math]\displaystyle{ \hat{X_i} := \{X_{i,n}\}_{n=1}^{N_i} }[/math] bag contains samples from a probability distribution [math]\displaystyle{ X_i }[/math] and the [math]\displaystyle{ i^\text{th} }[/math] output label is [math]\displaystyle{ y_i\in \R }[/math], one can tackle the distribution regression task by taking the embeddings of the distributions, and learning the regressor from the embeddings to the outputs. In other words, one can consider the following kernel ridge regression problem [math]\displaystyle{ (\lambda\gt 0) }[/math]
- [math]\displaystyle{ J(f) = \frac{1}{\ell} \sum_{i=1}^\ell \left[f\left(\mu_{\hat{X_i}}\right)-y_i\right]^2 + \lambda \|f\|_{\mathcal{H}(K)}^2 \to \min_{f\in \mathcal{H}(K)}, }[/math]
where
- [math]\displaystyle{ \mu_{\hat{X}_i} = \int_\Omega k(\cdot,u) \, \mathrm{d} \hat{X}_i(u)= \frac{1}{N_i} \sum_{n=1}^{N_i} k(\cdot, X_{i,n}) }[/math]
with a [math]\displaystyle{ k }[/math] kernel on the domain of [math]\displaystyle{ X_i }[/math]-s [math]\displaystyle{ (k:\Omega\times \Omega \to \R) }[/math], [math]\displaystyle{ K }[/math] is a kernel on the embedded distributions, and [math]\displaystyle{ \mathcal{H}(K) }[/math] is the RKHS determined by [math]\displaystyle{ K }[/math]. Examples for [math]\displaystyle{ K }[/math] include the linear kernel [math]\displaystyle{ \left[ K(\mu_P,\mu_Q) = \langle\mu_P,\mu_Q\rangle_{\mathcal{H}(k)} \right] }[/math], the Gaussian kernel [math]\displaystyle{ \left[ K(\mu_P,\mu_Q) = e^{-\left\|\mu_P-\mu_Q\right\|_{H(k)}^2/(2\sigma^2)} \right] }[/math], the exponential kernel [math]\displaystyle{ \left[ K(\mu_P,\mu_Q) = e^{-\left\|\mu_P-\mu_Q\right\|_{H(k)}/(2\sigma^2)} \right] }[/math], the Cauchy kernel [math]\displaystyle{ \left[ K(\mu_P,\mu_Q) = \left(1+ \left\|\mu_P-\mu_Q\right\|_{H(k)}^2/\sigma^2 \right)^{-1} \right] }[/math], the generalized t-student kernel [math]\displaystyle{ \left[ K(\mu_P,\mu_Q) = \left(1+ \left\|\mu_P-\mu_Q\right\|_{H(k)}^{\sigma} \right)^{-1}, (\sigma \le 2) \right] }[/math], or the inverse multiquadrics kernel [math]\displaystyle{ \left[ K(\mu_P,\mu_Q) = \left(\left\|\mu_P-\mu_Q\right\|_{H(k)}^2 + \sigma^2 \right)^{-\frac{1}{2}} \right] }[/math].
The prediction on a new distribution [math]\displaystyle{ (\hat{X}) }[/math] takes the simple, analytical form
- [math]\displaystyle{ \hat{y}\big(\hat{X}\big) = \mathbf{k} [\mathbf{G} + \lambda \ell]^{-1}\mathbf{y}, }[/math]
where [math]\displaystyle{ \mathbf{k}=\big[K \big(\mu_{\hat{X}_i},\mu_{\hat{X}}\big)\big]\in \R^{1\times \ell} }[/math], [math]\displaystyle{ \mathbf{G}=[G_{ij}]\in \R^{\ell\times \ell} }[/math], [math]\displaystyle{ G_{ij} = K\big(\mu_{\hat{X}_i},\mu_{\hat{X}_j}\big)\in \R }[/math], [math]\displaystyle{ \mathbf{y}=[y_1;\ldots;y_\ell]\in \R^\ell }[/math]. Under mild regularity conditions this estimator can be shown to be consistent and it can achieve the one-stage sampled (as if one had access to the true [math]\displaystyle{ X_i }[/math]-s) minimax optimal rate.[26] In the [math]\displaystyle{ J }[/math] objective function [math]\displaystyle{ y_i }[/math]-s are real numbers; the results can also be extended to the case when [math]\displaystyle{ y_i }[/math]-s are [math]\displaystyle{ d }[/math]-dimensional vectors, or more generally elements of a separable Hilbert space using operator-valued [math]\displaystyle{ K }[/math] kernels.
Example
In this simple example, which is taken from Song et al.,[2] [math]\displaystyle{ X, Y }[/math] are assumed to be discrete random variables which take values in the set [math]\displaystyle{ \{1,\ldots,K\} }[/math] and the kernel is chosen to be the Kronecker delta function, so [math]\displaystyle{ k(x,x') = \delta(x,x') }[/math]. The feature map corresponding to this kernel is the standard basis vector [math]\displaystyle{ \varphi(x) = \mathbf{e}_x }[/math]. The kernel embeddings of such a distributions are thus vectors of marginal probabilities while the embeddings of joint distributions in this setting are [math]\displaystyle{ K\times K }[/math] matrices specifying joint probability tables, and the explicit form of these embeddings is
- [math]\displaystyle{ \mu_X = \mathbb{E} [\mathbf{e}_X] = \begin{pmatrix} P(X=1) \\ \vdots \\ P(X=K) \\ \end{pmatrix} }[/math]
- [math]\displaystyle{ \mathcal{C}_{XY} = \mathbb{E} [\mathbf{e}_X \otimes \mathbf{e}_Y] = ( P(X=s, Y=t))_{s,t \in \{1,\ldots,K\}} }[/math]
The conditional distribution embedding operator,
- [math]\displaystyle{ \mathcal{C}_{Y\mid X} = \mathcal{C}_{YX} \mathcal{C}_{XX}^{-1}, }[/math]
is in this setting a conditional probability table
- [math]\displaystyle{ \mathcal{C}_{Y \mid X} = ( P(Y=s \mid X=t))_{s,t \in \{1,\dots,K\}} }[/math]
and
- [math]\displaystyle{ \mathcal{C}_{XX} =\begin{pmatrix} P(X=1) & \dots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \dots & P(X=K) \\ \end{pmatrix} }[/math]
Thus, the embeddings of the conditional distribution under a fixed value of [math]\displaystyle{ X }[/math] may be computed as
- [math]\displaystyle{ \mu_{Y \mid x} = \mathcal{C}_{Y \mid X} \varphi(x) = \begin{pmatrix} P(Y=1 \mid X = x) \\ \vdots \\ P(Y=K \mid X = x) \\ \end{pmatrix} }[/math]
In this discrete-valued setting with the Kronecker delta kernel, the kernel sum rule becomes
- [math]\displaystyle{ \underbrace{\begin{pmatrix} Q(X=1) \\ \vdots \\ P(X = N) \\ \end{pmatrix}}_{\mu_X^\pi} = \underbrace{\begin{pmatrix} \\ P(X=s \mid Y=t) \\ \\ \end{pmatrix}}_{\mathcal{C}_{X\mid Y}} \underbrace{\begin{pmatrix} \pi(Y=1) \\ \vdots \\ \pi(Y = N) \\ \end{pmatrix}}_{ \mu_Y^\pi} }[/math]
The kernel chain rule in this case is given by
- [math]\displaystyle{ \underbrace{\begin{pmatrix} \\ Q(X=s,Y=t) \\ \\ \end{pmatrix} }_{\mathcal{C}_{XY}^\pi} = \underbrace{\begin{pmatrix} \\ P(X=s \mid Y=t) \\ \\ \end{pmatrix} }_{\mathcal{C}_{X \mid Y}} \underbrace{ \begin{pmatrix} \pi(Y=1) & \dots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \dots & \pi(Y=K) \\ \end{pmatrix} }_{\mathcal{C}_{YY}^\pi} }[/math]
References
- ↑ 1.0 1.1 A. Smola, A. Gretton, L. Song, B. Schölkopf. (2007). A Hilbert Space Embedding for Distributions . Algorithmic Learning Theory: 18th International Conference. Springer: 13–31.
- ↑ 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 L. Song, K. Fukumizu, F. Dinuzzo, A. Gretton (2013). Kernel Embeddings of Conditional Distributions: A unified kernel framework for nonparametric inference in graphical models. IEEE Signal Processing Magazine 30: 98–111.
- ↑ J. Shawe-Taylor, N. Christianini. (2004). Kernel Methods for Pattern Analysis. Cambridge University Press, Cambridge, UK.
- ↑ T. Hofmann, B. Schölkopf, A. Smola. (2008). Kernel Methods in Machine Learning. The Annals of Statistics 36(3):1171–1220.
- ↑ Muandet, Krikamol; Fukumizu, Kenji; Sriperumbudur, Bharath; Schölkopf, Bernhard (2017-06-28). "Kernel Mean Embedding of Distributions: A Review and Beyond" (in English). Foundations and Trends in Machine Learning 10 (1–2): 1–141. doi:10.1561/2200000060. ISSN 1935-8237.
- ↑ 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 L. Song. (2008) Learning via Hilbert Space Embedding of Distributions. PhD Thesis, University of Sydney.
- ↑ K. Fukumizu, A. Gretton, X. Sun, and B. Schölkopf (2008). Kernel measures of conditional independence. Advances in Neural Information Processing Systems 20, MIT Press, Cambridge, MA.
- ↑ 8.0 8.1 8.2 L. Song, J. Huang, A. J. Smola, K. Fukumizu. (2009).Hilbert space embeddings of conditional distributions. Proc. Int. Conf. Machine Learning. Montreal, Canada: 961–968.
- ↑ *Steinwart, Ingo; Christmann, Andreas (2008). Support Vector Machines. New York: Springer. ISBN 978-0-387-77241-7.
- ↑ Sriperumbudur, B. K.; Fukumizu, K.; Lanckriet, G.R.G. (2011). "Universality, Characteristic Kernels and RKHS Embedding of Measures". Journal of Machine Learning Research 12 (70).
- ↑ Liang, Percy (2016), CS229T/STAT231: Statistical Learning Theory, Stanford lecture notes, https://web.stanford.edu/class/cs229t/notes.pdf
- ↑ Sriperumbudur, B. K.; Fukumizu, K.; Lanckriet, G.R.G. (2010). "On the relation between universality, characteristic kernels and RKHS embedding of measures". Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics. Italy. https://proceedings.mlr.press/v9/sriperumbudur10a.html.
- ↑ Micchelli, C.A.; Xu, Y.; Zhang, H. (2006). "Universal Kernels". Journal of Machine Learning Research 7 (95): 2651–2667. http://jmlr.org/papers/v7/micchelli06a.html.
- ↑ S. Grunewalder, G. Lever, L. Baldassarre, S. Patterson, A. Gretton, M. Pontil. (2012). Conditional mean embeddings as regressors. Proc. Int. Conf. Machine Learning: 1823–1830.
- ↑ A. Gretton, K. Borgwardt, M. Rasch, B. Schölkopf, A. Smola. (2012). A kernel two-sample test. Journal of Machine Learning Research, 13: 723–773.
- ↑ M. Dudík, S. J. Phillips, R. E. Schapire. (2007). Maximum Entropy Distribution Estimation with Generalized Regularization and an Application to Species Distribution Modeling. Journal of Machine Learning Research, 8: 1217–1260.
- ↑ A. Gretton, O. Bousquet, A. Smola, B. Schölkopf. (2005). Measuring statistical dependence with Hilbert–Schmidt norms. Proc. Intl. Conf. on Algorithmic Learning Theory: 63–78.
- ↑ L. Song, A. Smola, A. Gretton, K. Borgwardt, J. Bedo. (2007). Supervised feature selection via dependence estimation. Proc. Intl. Conf. Machine Learning, Omnipress: 823–830.
- ↑ L. Song, A. Smola, A. Gretton, K. Borgwardt. (2007). A dependence maximization view of clustering. Proc. Intl. Conf. Machine Learning. Omnipress: 815–822.
- ↑ L. Song, A. Smola, K. Borgwardt, A. Gretton. (2007). Colored maximum variance unfolding. Neural Information Processing Systems.
- ↑ Zoltán Szabó, Bharath K. Sriperumbudur. Characteristic and Universal Tensor Product Kernels. Journal of Machine Learning Research, 19:1–29, 2018.
- ↑ 22.0 22.1 K. Muandet, K. Fukumizu, F. Dinuzzo, B. Schölkopf. (2012). Learning from Distributions via Support Measure Machines. Advances in Neural Information Processing Systems: 10–18.
- ↑ 23.0 23.1 23.2 23.3 K. Zhang, B. Schölkopf, K. Muandet, Z. Wang. (2013). Domain adaptation under target and conditional shift. Journal of Machine Learning Research, 28(3): 819–827.
- ↑ 24.0 24.1 A. Gretton, A. Smola, J. Huang, M. Schmittfull, K. Borgwardt, B. Schölkopf. (2008). Covariate shift and local learning by distribution matching. In J. Quinonero-Candela, M. Sugiyama, A. Schwaighofer, N. Lawrence (eds.). Dataset shift in machine learning, MIT Press, Cambridge, MA: 131–160.
- ↑ 25.0 25.1 25.2 K. Muandet, D. Balduzzi, B. Schölkopf. (2013).Domain Generalization Via Invariant Feature Representation. 30th International Conference on Machine Learning.
- ↑ 26.0 26.1 Z. Szabó, B. Sriperumbudur, B. Póczos, A. Gretton. Learning Theory for Distribution Regression. Journal of Machine Learning Research, 17(152):1–40, 2016.
External links
- Information Theoretical Estimators toolbox (distribution regression demonstration).
Original source: https://en.wikipedia.org/wiki/Kernel embedding of distributions.
Read more |