Representer theorem

From HandWiki

For computer science, in statistical learning theory, a representer theorem is any of several related results stating that a minimizer [math]\displaystyle{ f^{*} }[/math] of a regularized empirical risk functional defined over a reproducing kernel Hilbert space can be represented as a finite linear combination of kernel products evaluated on the input points in the training set data.

Formal statement

The following Representer Theorem and its proof are due to Schölkopf, Herbrich, and Smola: [1]

Theorem: Consider a positive-definite real-valued kernel [math]\displaystyle{ k : \mathcal{X} \times \mathcal{X} \to \R }[/math] on a non-empty set [math]\displaystyle{ \mathcal{X} }[/math] with a corresponding reproducing kernel Hilbert space [math]\displaystyle{ H_k }[/math]. Let there be given

  • a training sample [math]\displaystyle{ (x_1, y_1), \dotsc, (x_n, y_n) \in \mathcal{X} \times \R }[/math],
  • a strictly increasing real-valued function [math]\displaystyle{ g \colon [0, \infty) \to \R }[/math], and
  • an arbitrary error function [math]\displaystyle{ E \colon (\mathcal{X} \times \R^2)^n \to \R \cup \lbrace \infty \rbrace }[/math],

which together define the following regularized empirical risk functional on [math]\displaystyle{ H_k }[/math]:

[math]\displaystyle{ f \mapsto E\left( (x_1, y_1, f(x_1)), \ldots, (x_n, y_n, f(x_n)) \right) + g\left( \lVert f \rVert \right). }[/math]

Then, any minimizer of the empirical risk

[math]\displaystyle{ f^{*} = \underset{f\in H_k}{\operatorname{arg min}} \left\lbrace E\left( (x_1, y_1, f(x_1)), \ldots, (x_n, y_n, f(x_n)) \right) + g\left( \lVert f \rVert \right) \right \rbrace, \quad (*) }[/math]

admits a representation of the form:

[math]\displaystyle{ f^{*}(\cdot) = \sum_{i = 1}^n \alpha_i k(\cdot, x_i), }[/math]

where [math]\displaystyle{ \alpha_i \in \R }[/math] for all [math]\displaystyle{ 1 \le i \le n }[/math].

Proof: Define a mapping

[math]\displaystyle{ \begin{align} \varphi \colon \mathcal{X} &\to H_k\\ \varphi(x) &= k(\cdot, x) \end{align} }[/math]

(so that [math]\displaystyle{ \varphi(x) = k(\cdot, x) }[/math] is itself a map [math]\displaystyle{ \mathcal{X} \to \R }[/math]). Since [math]\displaystyle{ k }[/math] is a reproducing kernel, then

[math]\displaystyle{ \varphi(x)(x') = k(x', x) = \langle \varphi(x'), \varphi(x) \rangle, }[/math]

where [math]\displaystyle{ \langle \cdot, \cdot \rangle }[/math] is the inner product on [math]\displaystyle{ H_k }[/math].

Given any [math]\displaystyle{ x_1, \ldots, x_n }[/math], one can use orthogonal projection to decompose any [math]\displaystyle{ f \in H_k }[/math] into a sum of two functions, one lying in [math]\displaystyle{ \operatorname{span} \left \lbrace \varphi(x_1), \ldots, \varphi(x_n) \right \rbrace }[/math], and the other lying in the orthogonal complement:

[math]\displaystyle{ f = \sum_{i = 1}^n \alpha_i \varphi(x_i) + v, }[/math]

where [math]\displaystyle{ \langle v, \varphi(x_i) \rangle = 0 }[/math] for all [math]\displaystyle{ i }[/math].

The above orthogonal decomposition and the reproducing property together show that applying [math]\displaystyle{ f }[/math] to any training point [math]\displaystyle{ x_j }[/math] produces

[math]\displaystyle{ f(x_j) = \left \langle \sum_{i = 1}^n \alpha_i \varphi(x_i) + v, \varphi(x_j) \right \rangle = \sum_{i = 1}^n \alpha_i \langle \varphi(x_i), \varphi(x_j) \rangle, }[/math]

which we observe is independent of [math]\displaystyle{ v }[/math]. Consequently, the value of the error function [math]\displaystyle{ E }[/math] in (*) is likewise independent of [math]\displaystyle{ v }[/math]. For the second term (the regularization term), since [math]\displaystyle{ v }[/math] is orthogonal to [math]\displaystyle{ \sum_{i = 1}^n \alpha_i \varphi(x_i) }[/math] and [math]\displaystyle{ g }[/math] is strictly monotonic, we have

[math]\displaystyle{ \begin{align} g\left( \lVert f \rVert \right) &= g \left( \lVert \sum_{i = 1}^n \alpha_i \varphi(x_i) + v \rVert \right) \\ &= g \left( \sqrt{ \lVert \sum_{i = 1}^n \alpha_i \varphi(x_i) \rVert^2 + \lVert v \rVert^2} \right) \\ &\ge g \left( \lVert \sum_{i = 1}^n \alpha_i \varphi(x_i) \rVert \right). \end{align} }[/math]

Therefore setting [math]\displaystyle{ v = 0 }[/math] does not affect the first term of (*), while it strictly decreases the second term. Consequently, any minimizer [math]\displaystyle{ f^{*} }[/math] in (*) must have [math]\displaystyle{ v = 0 }[/math], i.e., it must be of the form

[math]\displaystyle{ f^{*}(\cdot) = \sum_{i = 1}^n \alpha_i \varphi(x_i) = \sum_{i = 1}^n \alpha_i k(\cdot, x_i), }[/math]

which is the desired result.

Generalizations

The Theorem stated above is a particular example of a family of results that are collectively referred to as "representer theorems"; here we describe several such.

The first statement of a representer theorem was due to Kimeldorf and Wahba for the special case in which

[math]\displaystyle{ \begin{align} E\left( (x_1, y_1, f(x_1)), \ldots, (x_n, y_n, f(x_n)) \right) &= \frac{1}{n} \sum_{i = 1}^n (f(x_i) - y_i)^2, \\ g(\lVert f \rVert) &= \lambda \lVert f \rVert^2 \end{align} }[/math]

for [math]\displaystyle{ \lambda \gt 0 }[/math]. Schölkopf, Herbrich, and Smola generalized this result by relaxing the assumption of the squared-loss cost and allowing the regularizer to be any strictly monotonically increasing function [math]\displaystyle{ g(\cdot) }[/math] of the Hilbert space norm.

It is possible to generalize further by augmenting the regularized empirical risk functional through the addition of unpenalized offset terms. For example, Schölkopf, Herbrich, and Smola also consider the minimization

[math]\displaystyle{ \tilde{f}^{*} = \operatorname{arg min} \left\lbrace E\left( (x_1, y_1, \tilde{f}(x_1)), \ldots, (x_n, y_n, \tilde{f}(x_n)) \right) + g\left( \lVert f \rVert \right) \mid \tilde{f} = f + h \in H_k \oplus \operatorname{span} \lbrace \psi_p \mid 1 \le p \le M \rbrace \right \rbrace, \quad (\dagger) }[/math]

i.e., we consider functions of the form [math]\displaystyle{ \tilde{f} = f + h }[/math], where [math]\displaystyle{ f \in H_k }[/math] and [math]\displaystyle{ h }[/math] is an unpenalized function lying in the span of a finite set of real-valued functions [math]\displaystyle{ \lbrace \psi_p \colon \mathcal{X} \to \R \mid 1 \le p \le M \rbrace }[/math]. Under the assumption that the [math]\displaystyle{ n \times M }[/math] matrix [math]\displaystyle{ \left( \psi_p(x_i) \right)_{ip} }[/math] has rank [math]\displaystyle{ M }[/math], they show that the minimizer [math]\displaystyle{ \tilde{f}^{*} }[/math] in [math]\displaystyle{ (\dagger) }[/math] admits a representation of the form

[math]\displaystyle{ \tilde{f}^{*}(\cdot) = \sum_{i = 1}^n \alpha_i k(\cdot, x_i) + \sum_{p = 1}^M \beta_p \psi_p(\cdot) }[/math]

where [math]\displaystyle{ \alpha_i, \beta_p \in \R }[/math] and the [math]\displaystyle{ \beta_p }[/math] are all uniquely determined.

The conditions under which a representer theorem exists were investigated by Argyriou, Micchelli, and Pontil, who proved the following:

Theorem: Let [math]\displaystyle{ \mathcal{X} }[/math] be a nonempty set, [math]\displaystyle{ k }[/math] a positive-definite real-valued kernel on [math]\displaystyle{ \mathcal{X} \times \mathcal{X} }[/math] with corresponding reproducing kernel Hilbert space [math]\displaystyle{ H_k }[/math], and let [math]\displaystyle{ R \colon H_k \to \R }[/math] be a differentiable regularization function. Then given a training sample [math]\displaystyle{ (x_1, y_1), \ldots, (x_n, y_n) \in \mathcal{X} \times \R }[/math] and an arbitrary error function [math]\displaystyle{ E \colon (\mathcal{X} \times \R^2)^m \to \R \cup \lbrace \infty \rbrace }[/math], a minimizer

[math]\displaystyle{ f^{*} = \underset{f\in H_k} {\operatorname{arg min}} \left\lbrace E\left( (x_1, y_1, f(x_1)), \ldots, (x_n, y_n, f(x_n)) \right) + R(f) \right \rbrace \quad (\ddagger) }[/math]

of the regularized empirical risk admits a representation of the form

[math]\displaystyle{ f^{*}(\cdot) = \sum_{i = 1}^n \alpha_i k(\cdot, x_i), }[/math]

where [math]\displaystyle{ \alpha_i \in \R }[/math] for all [math]\displaystyle{ 1 \le i \le n }[/math], if and only if there exists a nondecreasing function [math]\displaystyle{ h \colon [0, \infty) \to \R }[/math] for which

[math]\displaystyle{ R(f) = h(\lVert f \rVert). }[/math]

Effectively, this result provides a necessary and sufficient condition on a differentiable regularizer [math]\displaystyle{ R(\cdot) }[/math] under which the corresponding regularized empirical risk minimization [math]\displaystyle{ (\ddagger) }[/math] will have a representer theorem. In particular, this shows that a broad class of regularized risk minimizations (much broader than those originally considered by Kimeldorf and Wahba) have representer theorems.

Applications

Representer theorems are useful from a practical standpoint because they dramatically simplify the regularized empirical risk minimization problem [math]\displaystyle{ (\ddagger) }[/math]. In most interesting applications, the search domain [math]\displaystyle{ H_k }[/math] for the minimization will be an infinite-dimensional subspace of [math]\displaystyle{ L^2(\mathcal{X}) }[/math], and therefore the search (as written) does not admit implementation on finite-memory and finite-precision computers. In contrast, the representation of [math]\displaystyle{ f^{*}(\cdot) }[/math] afforded by a representer theorem reduces the original (infinite-dimensional) minimization problem to a search for the optimal [math]\displaystyle{ n }[/math]-dimensional vector of coefficients [math]\displaystyle{ \alpha = (\alpha_1, \ldots, \alpha_n) \in \R^n }[/math]; [math]\displaystyle{ \alpha }[/math] can then be obtained by applying any standard function minimization algorithm. Consequently, representer theorems provide the theoretical basis for the reduction of the general machine learning problem to algorithms that can actually be implemented on computers in practice.

The following provides an example of how to solve for the minimizer whose existence is guaranteed by the representer theorem. This method works for any positive definite kernel [math]\displaystyle{ K }[/math], and allows us to transform a complicated (possibly infinite dimensional) optimization problem into a simple linear system that can be solved numerically.

Assume that we are using a least squares error function

[math]\displaystyle{ E[(x_1, y_1, f(x_1)), \dots, (x_n, y_n, f(x_n))] := \sum_{i=1}^n (y_i - f(x_i))^2 }[/math]

and a regularization function [math]\displaystyle{ g(x) = \lambda x^2 }[/math] for some [math]\displaystyle{ \lambda \gt 0 }[/math]. By the representer theorem, the minimizer

[math]\displaystyle{ f^* = \underset{f \in \mathcal{H}}{\operatorname{argmin}} \Big\{ E[(x_1, y_1, f(x_1)), \dots, (x_n, y_n, f(x_n))] + g(\|f\|_{\mathcal{H}}) \Big\} = \underset{f \in \mathcal{H}}{\operatorname{argmin}} \left\{ \sum_{i=1}^n (y_i - f(x_i))^2 + \lambda \|f\|_{\mathcal{H}}^2 \right\} }[/math]

has the form

[math]\displaystyle{ f^*(x) = \sum_{i=1}^n \alpha_i^* k(x, x_i) }[/math]

for some [math]\displaystyle{ \alpha^* = (\alpha_1^*, \dots, \alpha_n^*) \in \mathbb{R}^n }[/math]. Noting that

[math]\displaystyle{ \|f\|_{\mathcal{H}}^2 = \Big\langle \sum_{i=1}^n \alpha_i^* k(\cdot, x_i), \sum_{j=1}^n \alpha_j^* k(\cdot, x_j) \Big\rangle_{\mathcal{H}} = \sum_{i=1}^n \sum_{j=1}^n \alpha_i^* \alpha_j^* \big\langle k(\cdot, x_i), k(\cdot, x_j) \big\rangle_{\mathcal{H}} = \sum_{i=1}^n \sum_{j=1}^n \alpha_i^* \alpha_j^* k(x_i, x_j), }[/math]

we see that [math]\displaystyle{ \alpha^* }[/math] has the form

[math]\displaystyle{ \alpha^* = \underset{\alpha \in \mathbb{R}^n}{\operatorname{argmin}} \left\{ \sum_{i=1}^n \left(y_i - \sum_{j=1}^n \alpha_j k(x_i, x_j)\right)^2 + \lambda \|f\|_{\mathcal{H}}^2 \right\} = \underset{\alpha \in \mathbb{R}^n}{\operatorname{argmin}} \left\{ \|y - A \alpha\|^2 + \lambda \alpha^\intercal A \alpha \right\}. }[/math]


where [math]\displaystyle{ A_{ij} = k(x_i, x_j) }[/math] and [math]\displaystyle{ y = (y_1, \dots, y_n) }[/math]. This can be factored out and simplified to

[math]\displaystyle{ \alpha^* = \underset{\alpha \in \mathbb{R}^n}{\operatorname{argmin}} \left\{ \alpha^\intercal(A^\intercal A + \lambda A)\alpha - 2 \alpha^\intercal A y \right\}. }[/math]


Since [math]\displaystyle{ A^\intercal A + \lambda A }[/math] is positive definite, there is indeed a single global minimum for this expression. Let [math]\displaystyle{ F(\alpha) = \alpha^\intercal(A^\intercal A + \lambda A)\alpha - 2 \alpha^\intercal A y }[/math] and note that [math]\displaystyle{ F }[/math] is convex. Then [math]\displaystyle{ \alpha^* }[/math], the global minimum, can be solved by setting [math]\displaystyle{ \nabla_{\alpha} F = 0 }[/math]. Recalling that all positive definite matrices are invertible, we see that

[math]\displaystyle{ \nabla_{\alpha} F = 2(A^\intercal A + \lambda A)\alpha^* - 2Ay = 0 \Longrightarrow \alpha^* = (A^\intercal A + \lambda A)^{-1}Ay, }[/math]

so the minimizer may be found via a linear solve.

See also

References

  1. Schölkopf, Bernhard; Herbrich, Ralf; Smola, Alex J. (2001). "A Generalized Representer Theorem". in Helmbold, David; Williamson, Bob (in en). Computational Learning Theory. Lecture Notes in Computer Science. 2111. Berlin, Heidelberg: Springer. pp. 416–426. doi:10.1007/3-540-44581-1_27. ISBN 978-3-540-44581-4. https://link.springer.com/chapter/10.1007/3-540-44581-1_27. 
  • Argyriou, Andreas; Micchelli, Charles A.; Pontil, Massimiliano (2009). "When Is There a Representer Theorem? Vector Versus Matrix Regularizers". Journal of Machine Learning Research 10 (Dec): 2507–2529. 
  • Cucker, Felipe; Smale, Steve (2002). "On the Mathematical Foundations of Learning". Bulletin of the American Mathematical Society 39 (1): 1–49. doi:10.1090/S0273-0979-01-00923-5. 
  • Kimeldorf, George S.; Wahba, Grace (1970). "A correspondence between Bayesian estimation on stochastic processes and smoothing by splines". The Annals of Mathematical Statistics 41 (2): 495–502. doi:10.1214/aoms/1177697089. 
  • Schölkopf, Bernhard; Herbrich, Ralf; Smola, Alex J. (2001). "A Generalized Representer Theorem". Computational Learning Theory. Lecture Notes in Computer Science. 2111. pp. 416–426. doi:10.1007/3-540-44581-1_27. ISBN 978-3-540-42343-0.