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 \Omega on which a sensible kernel function (measuring similarity between elements of \Omega ) may be defined. For example, various kernels have been proposed for learning from data which are: vectors in \mathbb{R}^d, 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.

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.[5] 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:[5]

  1. Data may be modeled without restrictive assumptions about the form of the distributions and relationships between variables
  2. Intermediate density estimation is not needed
  3. Practitioners may specify the properties of a distribution most relevant for their problem (incorporating prior knowledge via choice of the kernel)
  4. 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
  5. 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.
  6. 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  X denote a random variable with codomain  \Omega and distribution  P(X) . Given a kernel  k on  \Omega \times \Omega , the Moore-Aronszajn Theorem asserts the existence of a RKHS  \mathcal{H} (a Hilbert space of functions  f: \Omega \mapsto \mathbb{R} equipped with inner products  \langle \cdot, \cdot \rangle_\mathcal{H} and norms  || \cdot ||_\mathcal{H} ) in which the element  \ k(x,\cdot) satisfies the reproducing property  \langle f, k(x,\cdot) \rangle_\mathcal{H} = f(x) \ \forall f \in \mathcal{H}, \forall x \in \Omega . One may alternatively consider  \ k(x,\cdot) an implicit feature mapping  \phi(x) from  \Omega to  \mathcal{H} (which is therefore also called the feature space), so that \ k(x, x') = \langle \phi(x), \phi(x')\rangle_\mathcal{H} can be viewed as a measure of similarity between points  x, x' \in \Omega . 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  P(X) in  \mathcal{H} (also called the kernel mean or mean map) is given by:[1]

\mu_X := \mathbb{E}_X [k(X, \cdot) ] = \mathbb{E}_X [\phi(X) ] = \int_\Omega \phi(x) \ \mathrm{d}P(x)

A kernel is characteristic if the mean embedding \mu: \{\text{family of distributions over }\Omega \} \mapsto \mathcal{H} is injective.[6] 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 n training examples  \{x_1, \dots, x_n\} drawn independently and identically distributed (i.i.d.) from  P , the kernel embedding of  P can be empirically estimated as

 \widehat{\mu}_X = \frac{1}{n} \sum_{i=1}^n \phi(x_i)

Joint distribution embedding

If  Y denotes another random variable (for simplicity, assume the domain of  Y is also  \Omega with the same kernel  k which satisfies  \langle \phi(x) \otimes \phi(y), \phi(x') \otimes \phi(y') \rangle = k(x,x') \otimes k(y,y')), then the joint distribution  P(X,Y) can be mapped into a tensor product feature space  \mathcal{H} \otimes \mathcal{H} via [2]

 \mathcal{C}_{XY} = \mathbb{E}_{XY} [\phi(X) \otimes \phi(Y)] = \int_{\Omega \times \Omega} \phi(x) \otimes \phi(y) \ \mathrm{d} P(x,y)

By the equivalence between a tensor and a linear map, this joint embedding may be interpreted as an uncentered cross-covariance operator  \mathcal{C}_{XY}: \mathcal{H} \mapsto \mathcal{H} from which the cross-covariance of mean-zero functions f,g \in \mathcal{H} can be computed as [7]

 \text{Cov}_{XY} (f(X), g(Y)) := \mathbb{E}_{XY} [f(X) g(Y)] = \langle f , \mathcal{C}_{XY} g \rangle_{\mathcal{H}} = \langle f \otimes g , \mathcal{C}_{XY} \rangle_{\mathcal{H} \otimes \mathcal{H}}

Given n pairs of training examples \{(x_1, y_1), \dots, (x_n, y_n)\} drawn i.i.d. from  P , we can also empirically estimate the joint distribution kernel embedding via

 \widehat{\mathcal{C}}_{XY} = \frac{1}{n} \sum_{i=1}^n \phi(x_i) \otimes \phi(y_i)

Conditional distribution embedding

Given a conditional distribution P(Y \mid X) , one can define the corresponding RKHS embedding as [2]

 \mu_{Y \mid x} = \mathbb{E}_{Y \mid x} [ \phi(Y) ] = \int_\Omega \phi(y) \ \mathrm{d}P(y \mid x)

Note that the embedding of P(Y \mid X) thus defines a family of points in the RKHS indexed by the values x taken by conditioning variable X . By fixing X to a particular value, we obtain a single element in \mathcal{H}, and thus it is natural to define the operator

\mathcal{C}_{Y \mid X}: \mathcal{H} \mapsto \mathcal{H} as  \mathcal{C}_{Y \mid X} = \mathcal{C}_{YX} \mathcal{C}_{XX}^{-1}

which given the feature mapping of x outputs the conditional embedding of Y given X = x. Assuming that for all  g \in \mathcal{H}: \ \mathbb{E}_{Y \mid X} [g(Y)] \in \mathcal{H} , it can be shown that [7]

 \mu_{Y \mid x} = \mathcal{C}_{Y \mid X} \phi(x)

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,  \mathcal{C}_{Y \mid X} \phi(x) may still be used to approximate the conditional kernel embedding  \mu_{Y \mid x} , and in practice, the inversion operator is replaced with a regularized version of itself  (\mathcal{C}_{XX} + \lambda \mathbf{I})^{-1} (where \mathbf{I} denotes the identity matrix).

Given training examples  \{(x_1, y_1),\dots, (x_n, y_n)\} , the empirical kernel conditional embedding operator may be estimated as [2]

\widehat{C}_{Y\mid X} = \boldsymbol{\Phi} (\mathbf{K} + \lambda \mathbf{I})^{-1} \boldsymbol{\Upsilon}^T

where \boldsymbol{\Phi} = \left(\phi(y_i),\dots, (y_n)\right), \boldsymbol{\Upsilon} = \left(\phi(x_i),\dots, (x_n)\right) are implicitly formed feature matrices, \mathbf{K} =\boldsymbol{\Upsilon}^T \boldsymbol{\Upsilon} is the Gram matrix for samples of X, and \lambda 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 Y in the feature space:

 \widehat{\mu}_{Y\mid x} = \sum_{i=1}^n \beta_i (x) \phi(y_i) = \boldsymbol{\Phi} \boldsymbol{\beta}(x) where   \boldsymbol{\beta}(x)   = (\mathbf{K} + \lambda \mathbf{I})^{-1} \mathbf{K}_x and   \mathbf{K}_x = \left( k(x_1, x), \dots, k(x_n, x)  \right)^T

Properties

 \mathbb{E}_X [f(X)] = \langle f, \mu_X \rangle_\mathcal{H}

Convergence of empirical kernel mean to the true distribution embedding

Universal kernels

 k(x,x') = \exp\left(-\frac{1}{2\sigma^2} ||x-x'||^2 \right)

on compact subsets of \mathbb{R}^d is universal.

Parameter selection for conditional distribution kernel embeddings

 \min_{\mathcal{C}: \mathcal{H} \mapsto \mathcal{H}} \sum_{i=1}^n || \phi(y_i) - \mathcal{C} \phi(x_i) ||_\mathcal{H}^2 + \lambda ||\mathcal{C} ||_{HS}^2  where  ||\cdot ||_{HS} is the Hilbert-Schmidt norm.

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][7] The following notation is adopted:

In practice, all embeddings are empirically estimated from data  \{(x_1,y_1),\dots, (x_n, y_n)\} and it assumed that a set of samples \{\widetilde{y}_1, \dots, \widetilde{y}_{\widetilde{n}} \} may be used to estimate the kernel embedding of the prior distribution  \pi(Y) .

Kernel sum rule

In probability theory, the marginal distribution of  X can be computed by integrating out  Y from the joint density (including the prior distribution on  Y )

 Q(X) = \int_\Omega P(X \mid Y) \mathrm{d} \pi(Y)

The analog of this rule in the kernel embedding framework states that  \mu_X^\pi , the RKHS embedding of  Q(X), can be computed via

  \mu_X^\pi = \mathbb{E}_{Y} [\mathcal{C}_{X \mid Y} \phi(Y) ] = \mathcal{C}_{X\mid Y} \mathbb{E}_{Y} [\phi(Y)] = \mathcal{C}_{X\mid Y}  \mu_Y^\pi    where \mu_Y^\pi is the kernel embedding of  \pi(Y)

In practical implementations, the kernel sum rule takes the following form

 \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}

where \mu_Y^\pi = \sum_{i=1}^{\widetilde{n}} \alpha_i \phi(\widetilde{y}_i) is the empirical kernel embedding of the prior distribution, \boldsymbol{\alpha}  = (\alpha_1, \dots, \alpha_{\widetilde{n}} )^T, \boldsymbol{\Upsilon} = \left(\phi(x_1), \dots, \phi(x_n) \right) , and \mathbf{G}, \widetilde{\mathbf{G}} are Gram matrices with entries \mathbf{G}_{ij} = k(y_i, y_j), \widetilde{\mathbf{G}}_{ij} = k(y_i, \widetilde{y}_j) respectively.

Kernel chain rule

In probability theory, a joint distribution can be factorized into a product between conditional and marginal distributions

 Q(X,Y) = P(X \mid Y) \pi(Y)

The analog of this rule in the kernel embedding framework states that  \mathcal{C}_{XY}^\pi , the joint embedding of  Q(X,Y) , can be factorized as a composition of conditional embedding operator with the auto-covariance operator associated with  \pi(Y)

 \mathcal{C}_{XY}^\pi = \mathcal{C}_{X \mid Y} \mathcal{C}_{YY}^\pi where  \mathcal{C}_{XY}^\pi = \mathbb{E}_{XY} [\phi(X) \otimes \phi(Y) ] and  \mathcal{C}_{YY}^\pi = \mathbb{E}_Y [\phi(Y) \otimes \phi(Y)]

In practical implementations, the kernel chain rule takes the following form

 \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}} \text{diag}(\boldsymbol{\alpha}) \boldsymbol{\widetilde{\Phi}}^T

Kernel Bayes' rule

In probability theory, a posterior distribution can be expressed in terms of a prior distribution and a likelihood function as

 Q(Y \mid x) = \frac{P(x \mid Y) \pi(Y)}{Q(x)}  where  Q(x) = \int_\Omega P(x \mid y) \mathrm{d} \pi(y)

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

 \mu_{Y \mid x}^\pi = \mathcal{C}_{Y \mid X}^\pi \phi(x) = \mathcal{C}_{YX}^\pi ( \mathcal{C}_{XX}^\pi )^{-1} \phi(x) where from the chain rule:   \mathcal{C}_{YX}^\pi = \left( \mathcal{C}_{X \mid Y} \mathcal{C}_{YY}^\pi \right)^T  .

In practical implementations, the kernel Bayes' rule takes the following form

 \widehat{\mu}_{Y \mid x}^\pi =   \widehat{\mathcal{C}}_{YX}^\pi \left( (\widehat{\mathcal{C}}_{XX})^2 + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widehat{\mathcal{C}}_{XX}^\pi  \phi(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

where  \boldsymbol{\Lambda} = \left(\mathbf{G} + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widetilde{\mathbf{G}} \text{diag}(\boldsymbol{\alpha}), \mathbf{D} = \text{diag}\left(\left(\mathbf{G} + \widetilde{\lambda} \mathbf{I} \right)^{-1} \widetilde{\mathbf{G}} \boldsymbol{\alpha} \right)   . Two regularization parameters are used in this framework: \lambda for the estimation of  \widehat{\mathcal{C}}_{YX}^\pi, \widehat{\mathcal{C}}_{XX}^\pi = \boldsymbol{\Upsilon} \mathbf{D} \boldsymbol{\Upsilon}^T and \widetilde{\lambda} for the estimation of the final conditional embedding operator  \widehat{\mathcal{C}}_{Y \mid X}^\pi = \widehat{\mathcal{C}}_{YX}^\pi \left( (\widehat{\mathcal{C}}_{XX}^\pi )^2 + \widetilde{\lambda} \mathbf{I}  \right)^{-1} \widehat{\mathcal{C}}_{XX}^\pi  . The latter regularization is done on square of  \widehat{\mathcal{C}}_{XX}^\pi  because  D may not be positive definite.

Applications

Measuring distance between distributions

The maximum mean discrepancy (MMD) is a distance-measure between distributions P(X) and Q(Y) which is defined as the squared distance between their embeddings in the RKHS [5]

\text{MMD}(P,Q) = \left| \left| \mu_X - \mu_Y \right| \right|_{\mathcal{H}}^2

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,[5] 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

\text{MMD}(P,Q) = \sup_{||f ||_\mathcal{H} \le 1} \left( \mathbb{E}_X[f(X)] - \mathbb{E}_Y[f(Y)]  \right)

Kernel two sample test

Given n training examples from P(X) and m samples from Q(Y), one can formulate a test statistic based on the empirical estimate of the MMD

\widehat{\text{MMD}}(P,Q) = \left| \left| \frac{1}{n}\sum_{i=1}^n \phi(x_i) - \frac{1}{m}\sum_{i=1}^m \phi(y_i) \right| \right|_{\mathcal{H}}^2 = \frac{1}{nm} \sum_{i=1}^n\sum_{j=1}^m \left[ k(x_i, x_j) + k(y_i, y_j) - 2 k(x_i, y_j) \right]

to obtain a two-sample test [10] of the null hypothesis that both samples stem from the same distribution (i.e. P = Q) against the broad alternative P \neq Q.

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 P_X^*. This can be done by solving the following optimization problem [5][11]

 \max_{P_X} H(P_X) subject to  ||\widehat{\mu}_X - \mu_X[P_X] ||_\mathcal{H} \le \epsilon

where the maximization is done over the entire space of distributions on  \Omega . Here,  \mu_X[P_X] is the kernel embedding of the proposed density  P_X and H 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.[5]

Measuring dependence of random variables

A measure of the statistical dependence between random variables  X and  Y (from any domains on which sensible kernels can be defined) can be formulated based on the Hilbert–Schmidt Independence Criterion [12]

 \text{HSIC}(X, Y) = \left| \left| \mathcal{C}_{XY} - \mu_X \otimes \mu_Y  \right| \right|_{\mathcal{H} \otimes \mathcal{H}}^2

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 O(n(d_f^2 +d_g^2)) time,[5] where the Gram matrices of the two datasets are approximated using \mathbf{A} \mathbf{A}^T, \mathbf{B} \mathbf{B}^T with  \mathbf{A} \in \mathbb{R}^{n \times d_f},  \mathbf{B} \in \mathbb{R}^{n \times d_g}. 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 [13]), clustering (CLUHSIC [14]), and dimensionality reduction (MUHSIC [15]).

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  m_{ut}(\cdot) = \sum_{i=1}^n \beta_{ut}^i \phi(x_t^i) if it assumed to lie in the RKHS. The kernel belief propagation update message from t to node s is then given by [2]

 \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 \phi(x_s)

where  \odot denotes the element-wise vector product, N(t) \backslash s is the set of nodes connected to t excluding node s,  \boldsymbol{\beta}_{ut} = \left(\beta_{ut}^1, \dots, \beta_{ut}^n \right) , \mathbf{K}_t, \mathbf{K}_s are the Gram matrices of the samples from variables X_t, X_s , respectively, and \boldsymbol{\Upsilon}_s = \left(\phi(x_s^1),\dots, \phi(x_s^n)\right) is the feature matrix for the samples from X_s.

Thus, if the incoming messages to node t are linear combinations of feature mapped samples from  X_t , then the outgoing message from this node is also a linear combination of feature mapped samples from  X_s . 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]

Nonparametric filtering in hidden Markov models

In the hidden Markov model (HMM), two key quantities of interest are the transition probabilities between hidden states  P(S^t \mid S^{t-1}) and the emission probabilities  P(O^t \mid S^t) 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  s^{t} at time step t given a history of previous observations h^t = (o^1, \dots, o^t) from the system. In filtering, a belief state  P(S^{t+1} \mid h^{t+1})  is recursively maintained via a prediction step (where updates P(S^{t+1} \mid h^t) = \mathbb{E}_{S^t \mid h^t} [P(S^{t+1} \mid S^t)] are computed by marginalizing out the previous hidden state) followed by a conditioning step (where updates  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) 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

 \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} \phi(o^{t+1})

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 (\widetilde{s}^1, \dots, \widetilde{s}^T, \widetilde{o}^1, \dots, \widetilde{o}^T) is given, one can in practice estimate  \widehat{\mu}_{S^{t+1} \mid h^{t+1}} = \sum_{i=1}^T \alpha_i^t \phi(\widetilde{s}^t) and filtering with kernel embeddings is thus implemented recursively using the following updates for the weights \boldsymbol{\alpha} = (\alpha_1, \dots, \alpha_T) [2]

 \mathbf{D}^{t+1} = \text{diag}\left((G+\lambda \mathbf{I})^{-1} \widetilde{G} \boldsymbol{\alpha}^t  \right)
 \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}}

where  \mathbf{G}, \mathbf{K} denote the Gram matrices of \widetilde{s}^1, \dots, \widetilde{s}^T and  \widetilde{o}^1, \dots, \widetilde{o}^T respectively,  \widetilde{\mathbf{G}} is a transfer Gram matrix defined as  \widetilde{\mathbf{G}}_{ij} = k(\widetilde{s}_i, \widetilde{s}_{j+1}) , and  \mathbf{K}_{o^{t+1}} = (k(\widetilde{o}^1, o^{t+1}), \dots, k(\widetilde{o}^T, o^{t+1}))^T .

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  \{P_i, y_i\}_{i=1}^n, \ y_i \in \{+1, -1\} .[16] SMMs solve the standard SVM dual optimization problem using the following expected kernel

 K\left(P(X), Q(Z)\right) = \langle \mu_X , \mu_Z \rangle_\mathcal{H} = \mathbb{E}_{XZ} [k(x,z)]

which is computable in closed form for many common specific distributions  P_i (such as the Gaussian distribution) combined with popular embedding kernels k (e.g. the Gaussian kernel or polynomial kernel), or can be accurately empirically estimated from i.i.d. samples \{x_i\}_{i=1}^n \sim P(X), \{z_j\}_{j=1}^m \sim Q(Z) via

 \widehat{K} \left(X, Z\right) = \frac{1}{n m} \sum_{i=1}^n \sum_{j=1}^m k(x_i, z_j)

Under certain choices of the embedding kernel k, the SMM applied to training examples \{P_i, y_i\}_{i=1}^n is equivalent to a SVM trained on samples \{x_i, y_i\}_{i=1}^n, 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  P_i ) may be placed on each training point.[16]

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  \{ (x_i^{tr}, y_i^{tr}) \}_{i=1}^n and a test set  \{ (x_j^{te}, y_j^{te}) \}_{j=1}^m where the  y_j^{te} are unknown, three types of differences are commonly assumed between the distribution of the training examples  P^{tr}(X,Y) and the test distribution  P^{te}(X,Y):[17][18]

  1. Covariate Shift in which the marginal distribution of the covariates changes across domains:  P^{tr}(X) \neq P^{te}(X)
  2. Target Shift in which the marginal distribution of the outputs changes across domains:  P^{tr}(Y) \neq P^{te}(Y)
  3. Conditional Shift in which  P(Y) remains the same across domains, but the conditional distributions differ:  P^{tr}(X \mid Y) \neq P^{te}(X \mid Y). In general, the presence of conditional shift leads to an ill-posed problem, and the additional assumption that  P(X \mid Y) changes only under location-scale (LS) transformations on  X 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 P^{te}(X) / P^{tr}(X) obtained directly from the kernel embeddings of the marginal distributions of X in each domain without any need for explicit estimation of the distributions.[18] Target shift, which cannot be similarly dealt with since no samples from Y are available in the test domain, is accounted for by weighting training examples using the vector \boldsymbol{\beta}^*(\mathbf{y}^{tr}) which solves the following optimization problem (where in practice, empirical approximations must be used) [17]

 \min_{\boldsymbol{\beta}(y)} \left|\left|\mathcal{C}_{{(X \mid Y)}^{tr}} \mathbb{E}_{Y^{tr}} [ \boldsymbol{\beta}(y) \phi(y)] - \mu_{X^{te}} \right|\right|_\mathcal{H}^2  subject to  \boldsymbol{\beta}(y) \ge 0, \mathbb{E}_{Y^{tr}} [ \boldsymbol{\beta}(y)] = 1

To deal with location scale conditional shift, one can perform a LS transformation of the training points to obtain new transformed training data  \mathbf{X}^{new} =  \mathbf{X}^{tr} \odot \mathbf{W} + \mathbf{B} (where \odot denotes the element-wise vector product). To ensure similar distributions between the new transformed training samples and the test data, \mathbf{W},\mathbf{B} are estimated by minimizing the following empirical kernel embedding distance [17]

 \left| \left| \widehat{\mu}_{X^{new}} - \widehat{\mu}_{X^{te}}    \right| \right|_{\mathcal{H}}^2  =  \left| \left| \widehat{\mathcal{C}}_{(X \mid Y)^{new}} \widehat{\mu}_{Y^{tr}} -  \widehat{\mu}_{X^{te}} \right| \right|_{\mathcal{H}}^2

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.[17]

Domain generalization via invariant feature representation

Given N sets of training examples sampled i.i.d. from distributions P^{(1)}(X,Y), P^{(2)}(X,Y), \dots, P^{(N)}(X,Y), the goal of domain generalization is to formulate learning algorithms which perform well on test examples sampled from a previously unseen domain P^*(X,Y) where no data from the test domain is available at training time. If conditional distributions P(Y \mid X) 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 P(X). 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.[19] 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.[19]

Defining a probability distribution \mathcal{P} on the RKHS \mathcal{H} with \mathcal{P}(\mu_{X^{(i)}Y^{(i)}}) = 1/N \text{ for } i=1,\dots, N, DICA measures dissimilarity between domains via distributional variance which is computed as

V_\mathcal{H} (\mathcal{P}) = \frac{1}{N} \text{tr}(\mathbf{G}) - \frac{1}{N^2} \sum_{i,j=1}^N \mathbf{G}_{ij} where \mathbf{G}_{ij}  = \langle \mu_{X^{(i)}}, \mu_{X^{(j)}} \rangle_\mathcal{H}

so \mathbf{G} is a N \times N 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 Y becomes independent of X given C^T X across all domains. In the absence of target values Y, an unsupervised version of DICA may be formulated which finds a low-dimensional subspace that minimizes distributional variance while simultaneously maximizing the variance of X (in the feature space) across all domains (rather than preserving a central subspace).[19]

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.[20]

Given {\left(\{X_{i,n}\}_{n=1}^{N_i}, y_i\right)}_{i=1}^{\ell} training data, where the \hat{X_i} := \{X_{i,n}\}_{n=1}^{N_i} bag contains samples from a probability distribution X_i and the i^{th} output label is y_i\in \mathbb{R}, 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 (\lambda>0)

  J(f) = \frac{1}{\ell} \sum_{i=1}^{\ell} \left[f\left(\mu_{\hat{X_i}}\right)-y_i\right]^2 + \lambda \left\|f\right\|_{\mathcal{H}(K)}^2 \rightarrow \min_{f\in \mathcal{H}(K)},

where \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}) with a k kernel on the domain of X_i-s (k:\Omega\times \Omega \rightarrow \mathbb{R}), K is a kernel on the embedded distributions, and \mathcal{H}(K) is the RKHS determined by K. Examples for K include the linear kernel  \left[ K(\mu_P,\mu_Q) = \langle\mu_P,\mu_Q\rangle_{\mathcal{H}(k)} \right] , the Gaussian kernel  \left[ K(\mu_P,\mu_Q) = e^{-\left\|\mu_P-\mu_Q\right\|_{H(k)}^2/(2\sigma^2)} \right] , the exponential kernel  \left[ K(\mu_P,\mu_Q) = e^{-\left\|\mu_P-\mu_Q\right\|_{H(k)}/(2\sigma^2)} \right] , the Cauchy kernel  \left[ K(\mu_P,\mu_Q) =  \left(1+ \left\|\mu_P-\mu_Q\right\|_{H(k)}^2/\sigma^2 \right)^{-1} \right] , the generalized t-student kernel  \left[ K(\mu_P,\mu_Q) =  \left(1+ \left\|\mu_P-\mu_Q\right\|_{H(k)}^{\sigma} \right)^{-1}, (\sigma \le 2) \right] , or the inverse multiquadrics kernel  \left[ K(\mu_P,\mu_Q) =  \left(\left\|\mu_P-\mu_Q\right\|_{H(k)}^2 + \sigma^2 \right)^{-\frac{1}{2}} \right] .

The prediction on a new distribution (\hat{X}) takes the simple, analytical form

 \hat{y}\big(\hat{X}\big) = \mathbf{k} [\mathbf{G} + \lambda \ell]^{-1}\mathbf{y},

where \mathbf{k}=\big[K \big(\mu_{\hat{X}_i},\mu_{\hat{X}}\big)\big]\in \mathbb{R}^{1\times \ell}, \mathbf{G}=[G_{ij}]\in \mathbb{R}^{\ell\times \ell}, G_{ij} = K\big(\mu_{\hat{X}_i},\mu_{\hat{X}_j}\big)\in \mathbb{R}, \mathbf{y}=[y_1;...;y_l]\in \R^{\ell}. 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 X_i-s) minimax optimal rate.[20] In the J objective function y_i-s are real numbers; the results can also be extended to the case when y_i-s are d-dimensional vectors, or more generally elements of a separable Hilbert space using operator-valued K kernels.

Example

In this simple example, which is taken from Song et al.,[2] X, Y are assumed to be discrete random variables which take values in the set \{1,\dots,K\} and the kernel is chosen to be the Kronecker delta function, so k(x,x') = \delta(x,x'). The feature map corresponding to this kernel is the standard basis vector \phi(x) = \mathbf{e}_x. The kernel embeddings of such a distributions are thus vectors of marginal probabilities while the embeddings of joint distributions in this setting are K\times K matrices specifying joint probability tables, and the explicit form of these embeddings is

\mu_X = \mathbb{E}_X [\mathbf{e}_x] = \left(
\begin{array}{c}
P(X=1) \\
\vdots \\
P(X=K) \\
\end{array}
\right)
 \mathcal{C}_{XY} = \mathbb{E}_{XY} [\mathbf{e}_X \otimes e_Y] = \bigg( P(X=s, Y=t) \bigg)_{s,t \in \{1,\dots,K\}}

The conditional distribution embedding operator  \mathcal{C}_{Y\mid X} = \mathcal{C}_{YX} \mathcal{C}_{XX}^{-1} is in this setting a conditional probability table

 \mathcal{C}_{Y \mid X} = \bigg( P(Y=s \mid X=t) \bigg)_{s,t \in \{1,\dots,K\}}
and  \mathcal{C}_{XX} =\left(
\begin{array}{c c c}
P(X=1) & \dots & 0 \\
\vdots & \ddots  & \vdots \\
0 & \dots & P(X=K) \\
\end{array}
\right)

Thus, the embeddings of the conditional distribution under a fixed value of X may be computed as

 \mu_{Y \mid x} = \mathcal{C}_{Y \mid X} \phi(x) = \left(
\begin{array}{c}
P(Y=1 \mid X = x) \\
\vdots \\
P(Y=K \mid X = x) \\
\end{array}
\right)

In this discrete-valued setting with the Kronecker delta kernel, the kernel sum rule becomes

 \underbrace{ \left(
\begin{array}{c}
Q(X=1) \\
\vdots \\
P(X = N) \\
\end{array}
\right) }_{\mu_Y^\pi} = \underbrace{ \left( \begin{array}{c} \\  P(X=s \mid Y=t) \\ \\ \end{array} \right) }_{ \mathcal{C}_{X\mid Y} } \underbrace{ \left(
\begin{array}{c}
\pi(Y=1) \\
\vdots \\
pi(Y = N) \\
\end{array}
\right) }_{ \mu_Y^\pi}

The kernel chain rule in this case is given by

 \underbrace{ \left( \begin{array}{c} \\ Q(X=s,Y=t) \\ \\ \end{array} \right) }_{\mathcal{C}_{XY}^\pi} =
 \underbrace{ \left( \begin{array}{c} \\ P(X=s \mid Y=t) \\ \\ \end{array} \right) }_{\mathcal{C}_{X \mid Y}} 
\underbrace{ \left(
\begin{array}{c c c}
\pi(Y=1) & \dots & 0 \\
\vdots & \ddots  & \vdots \\
0 & \dots & \pi(Y=K) \\
\end{array} 
\right) }_{\mathcal{C}_{YY}^\pi}

References

  1. 1 2 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. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 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.
  3. J. Shawe-Taylor, N. Christianini. (2004). Kernel Methods for Pattern Analysis. Cambridge University Press, Cambridge, UK.
  4. T. Hofmann, B. Schölkopf, A. Smola. (2008). Kernel Methods in Machine Learning. The Annals of Statistics 36(3):1171–1220.
  5. 1 2 3 4 5 6 7 8 9 L. Song. (2008) Learning via Hilbert Space Embedding of Distributions. PhD Thesis, University of Sydney.
  6. 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.
  7. 1 2 3 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.
  8. A. Gretton, K. Borgwardt, M. Rasch, B. Schölkopf, A. Smola. (2007). A kernel method for the two-sample-problem. Advances in Neural Information Processing Systems 19, MIT Press, Cambridge, MA.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. L. Song, A. Smola, A. Gretton, K. Borgwardt. (2007). A dependence maximization view of clustering. Proc. Intl. Conf. Machine Learning. Omnipress: 815–822.
  15. L. Song, A. Smola, K. Borgwardt, A. Gretton. (2007). Colored maximum variance unfolding. Neural Information Processing Systems.
  16. 1 2 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.
  17. 1 2 3 4 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.
  18. 1 2 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.
  19. 1 2 3 K. Muandet, D. Balduzzi, B. Schölkopf. (2013).Domain Generalization Via Invariant Feature Representation. 30th International Conference on Machine Learning.
  20. 1 2 Z. Szabó, B. Sriperumbudur, B. Póczos, A. Gretton. Learning Theory for Distribution Regression. Technical report, 2016.

External links

This article is issued from Wikipedia - version of the Wednesday, April 13, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.