Chapter 11: machine learning

Chapter 11 · book pp. 231–278 · Shun-ichi Amari, Information Geometry and Its Applications (2016)

clusteringbregman-divergencek-meansvoronoi-diagramchernoff-informationsupport-vector-machinekernelconformal-transformationbelief-propagationmean-fieldcccpboostingadaboostbayesian-dualityrestricted-boltzmann-machinecontrastive-divergencenatural-gradient

Notes for Chapter 11 of Amari, Information Geometry and Its Applications (Springer, 2016). The next section summarises the book’s chapter in my own words. The sections after it are explorations that I asked for, one at a time, so they follow my questions and not the book’s order. They keep the intuition, the figures and the derivations, and leave out numerical checks.

What the chapter covers (a summary of the book’s chapter)

The chapter takes the geometry of Part I (convex potentials, Bregman divergences, e- and m-projections, Pythagoras) and tries it on five standard problems of machine learning. The sections are short and fairly independent: each one recasts a known algorithm as a geometric operation and then points to what the geometry suggests. The sections in order:

In one paragraph

The chapter tries the dually flat geometry of Part I on five problems of machine learning, loosely connected, each a few pages. Clustering: if closeness is measured by a Bregman divergence, the representative of a group of patterns is still their arithmetic mean (when the representative sits in the right slot of the divergence), k-means works word for word, the cells of the resulting Voronoi diagram have flat boundaries, the stochastic version is an exponential family fitted by EM, a rescaled divergence gives centres that ignore outliers, and the error rate of a two-class decision rule decays with a divergence, the Chernoff information. Support vector machines: patterns are embedded in a feature space; the kernel is the inner product there, it induces a Riemannian metric on the pattern space, and multiplying the kernel by a position-dependent factor magnifies that metric near the support vectors. Belief propagation (BP) approximates the marginals of a graphical model; geometrically it alternates between an independent distribution and one-interaction models, matching means by m-projection and adding up “beliefs” in the e-coordinates; it is exact on trees, and the CCCP algorithm enforces the same two conditions in the other order. Boosting adds weak classifiers one at a time, the weight of each being a projection of the data. Bayesian inference and deep learning: the joint law of data and parameter has two exponential faces, a restricted Boltzmann machine is such a joint law, its learning rule is the em algorithm, contrastive divergence is a chain of m-projections with a Pythagorean bookkeeping, and the Gaussian machine turns out to do PCA with a noise floor. I re-derived every one of these on small cases. The geometry survives, but the printed text has an unusual density of slips, several of which change a statement (the boundary of two Bregman cells is flat in the other coordinate system; the M-step (11.32) lacks a division; that M^* contains q on a tree is false; the simplified CCCP does not always converge; the weights in (11.233) lose a factor), and I list them under Checks of the book’s statements near the end.

The spine of the argument

  1. With a Bregman divergence D_\varphi[x:\eta], the centre of a cluster is the mean of its members, for every \varphi (Theorem 11.1); so k-means, with its two steps, carries over unchanged (§11.1.1–11.1.3).
  2. The boundary between two cells is a hyperplane orthogonal to the geodesic joining the centres and meeting it at the equidistant point (Theorem 11.2; the printed version has e and m exchanged); a cluster defines an exponential family p\propto e^{-D_\varphi}, a mixture of them is fitted by EM (soft k-means), and priors shift the boundary by \log(\pi_i/\pi_j) (Theorem 11.4) (§11.1.4–11.1.5).
  3. Dividing the divergence by a slope-dependent factor (total Bregman divergence) makes centres robust to outliers; the exponent of the Bayes error of a two-class decision is the Chernoff information, the KL divergence from the point where the e-geodesic between the classes crosses the decision boundary to either class (§11.1.6–11.1.7).
  4. A support vector machine maximises the margin, and its dual depends on inner products only; a kernel is such an inner product after an embedding, g_{ij}=\partial_i\partial'_jK|_{x'=x} is the metric the embedding induces, and \tilde K=\sigma\sigma'K changes it by \sigma^2g+\nabla\sigma\nabla\sigma^{\mathsf T} (§11.2).
  5. Binary graphical models are exponential families; the independent ones form an e-flat M_0; the m-projection onto M_0 gives the true marginals (Theorem 11.6), the e-projection is mean field (§11.3.1–11.3.2).
  6. BP = repeated m-projection of one-clique models onto M_0 and addition of the beliefs; at a fixed point an m-condition and an e-condition hold (Theorem 11.7); the answer is exact on trees (Theorem 11.8); CCCP enforces the conditions in the opposite order (§11.3.3–11.3.5).
  7. Boosting: the weights W_t\propto e^{-yF_t} form an exponential family on the training set, and the weight \alpha of the next machine comes from an m-projection of the empirical distribution onto a one-dimensional family (§11.4).
  8. p(x,\theta) has two exponential faces, with x natural for \theta and the other way round (Bayesian duality); a restricted Boltzmann machine is such a joint law, learning is the em algorithm between a data manifold and a model manifold (Theorems 11.9–11.10), contrastive divergence is an alternating chain of m-projections (Theorems 11.11–11.12), and the Gaussian machine finds the leading principal components (Theorem 11.13) (§11.5).

Setup and notation

Symbol Meaning In the examples
\varphi,\psi dual convex potentials, \theta=\nabla\varphi(\eta), \eta=\nabla\psi(\theta), \psi(\theta)+\varphi(\eta)=\theta\cdot\eta (11.4)–(11.6) \tfrac12\lvert x\rvert^2; \sum(x\log x-x); -\sum\log x
D_\varphi[x:\eta] \varphi(x)-\varphi(\eta)-\nabla\varphi(\eta)\cdot(x-\eta) (11.3); the pattern x (in \eta-coordinates) is in the first slot, the centre in the second =D_\psi[\theta:\theta_x]=\mathrm{KL}[p_x:p_\eta] for an exponential family
G^{-1}=\nabla\nabla\varphi inverse Fisher metric in the \eta chart (11.11) \operatorname{diag}(1/x) for generalised KL
\eta_C, B_{ij} centre of a cluster (11.7); boundary of two cells (11.18)
z(x), K(x,x') feature map and kernel K=z\cdot z' (11.79). The book writes \varphi for the embedding too; I write z so that it does not clash with the potential z=(x_1,x_2,x_1^2+x_2^2) (11.78)
g_{ij}, \sigma(x), \tilde K metric induced by K (11.90); conformal factor; \tilde K=\sigma(x)\sigma(x')K (11.92) \tfrac{2}{\sigma_w^2}\delta_{ij} for the Gaussian kernel
q(x), M_0, M_r, \tilde M target law on x\in\{\pm1\}^n; independent laws; the one-clique model of clique r; the big family (11.107)–(11.113), (11.127) Ising model q\propto e^{h\cdot x+\sum_rw_rx_ix_j}
\theta_0,\theta_r,\xi_r parameters of the point of M_0 and of M_r (added to h); the belief of clique r (11.134)
E^*, M^* e-flat and m-flat hulls of the fixed point’s p_r^* and p_0^* (11.138)–(11.139)
F_t=\sum_a\alpha_ah_a, W_t, \varepsilon_t, Z_t boosting: output, weights on examples, weighted error, normaliser
p(v,h;W), p_V, M_{V,H\vert q} restricted Boltzmann machine, its visible marginal, the data manifold \{q(v)r(h\vert v)\} (11.192), (11.203)
p_j, \tilde p_j the \mathrm{CD}_j distribution and its half-step (11.213)–(11.214)

Running examples. Small toy cases throughout: a few patterns in the positive quadrant with the generalised KL divergence, and two Poisson laws for the decision problem; a separable point set and a noisy circle for the kernel pictures; a handful of \pm1 spins on a cycle with fields and a common coupling that I vary as a dial; a toy set of training points with decision stumps for boosting; and a small binary RBM, small enough to list all its states, and a Gaussian one.

1. Clustering with a divergence (§11.1)

1.1 The centre of a cluster (Theorem 11.1)

In plain words. A divergence D[x:c] says how badly c stands in for x; it need not be symmetric. A Bregman divergence is the vertical gap between a convex curve \varphi above the point x and the tangent line to the curve drawn at c: half the squared distance for \varphi=\tfrac12x^2, the generalised Kullback–Leibler divergence \sum x\log(x/c)-x+c for \varphi=x\log x-x, the Itakura–Saito divergence for \varphi=-\log x. The centre of a cluster is the point c with the smallest average divergence from its members. For squared distance that is the arithmetic mean, as everyone using k-means knows. Theorem 11.1 (Banerjee et al.) says it stays the arithmetic mean for every Bregman divergence. The proviso the book does not state: this is for the centre in the second slot, \frac1k\sum_iD_\varphi[x_i:c]; with the centre in the first slot the minimiser is the mean in the dual coordinates \theta=\nabla\varphi.

Example. Take a few patterns in the positive quadrant with the generalised KL divergence. The arithmetic mean and the geometric mean (the mean in \theta=\log x) are two different points. With the centre in the second slot the arithmetic mean has the smaller average divergence; with the centre in the first slot the geometric mean wins. Each slot has its own winner (first widget).

Formal statement. With x=\eta in the \eta-chart, D_\varphi[x:\eta]=\varphi(x)-\varphi(\eta)-\nabla\varphi(\eta)\cdot(x-\eta) (11.3). Differentiating in the second argument gives \partial_\eta D_\varphi[x:\eta]=-\nabla\nabla\varphi(\eta)\,(x-\eta)=-G^{-1}(\eta)(x-\eta), so the average (11.7) is stationary where \sum_i(x_i-\eta)=0, which is (11.9); G^{-1} is positive definite, so it is the minimum. Integrating against a density p instead of summing gives (11.12)–(11.13): the centre of a distribution is its expectation.

Remarks on the book’s statement.

1.2 k-means (§11.1.3)

In plain words. Alternate two steps: assign each pattern to the centre with the smallest divergence (11.16), then move each centre to the mean of its cluster. Each step lowers the total cost (11.15) (the first by definition, the second by Theorem 11.1), there are finitely many partitions, so the procedure stops; where it stops is a local optimum.

A remark. There is no guarantee of optimality: the final partition depends on the starting centres, and k-means can stop at a local optimum that is worse than the best partition, for Bregman divergences just as in the Euclidean case. In every case I tried the cost never increased between steps.

1.3 The Voronoi diagram (§11.1.4, Theorem 11.2)

In plain words. The cell of a centre is the set of patterns closer to it than to any other centre, and neighbouring cells are separated by bisectors, where two divergences are equal. For squared distance these are the familiar straight perpendicular bisectors. Theorem 11.2 describes them for a Bregman divergence in geometric terms (a hyperplane orthogonal to a geodesic through an equidistant point), but as printed it has the two kinds of straightness exchanged.

The computation. With \theta_i=\nabla\varphi(\eta_i), D_\varphi[x:\eta_1]-D_\varphi[x:\eta_2]=(\theta_2-\theta_1)\cdot x+\text{const}, since the \varphi(x) cancels and what is left is linear in x=\eta. So B_{12} is a hyperplane in the pattern coordinates \eta with normal \theta_2-\theta_1: an m-flat hypersurface. The geodesic joining the centres that it meets orthogonally is the one that is straight in \theta (the e-geodesic \theta_t=(1-t)\theta_1+t\theta_2), because a vector \delta\theta and a covector \delta\eta are orthogonal in the Fisher metric exactly when \delta\theta\cdot\delta\eta=0. It meets B_{12} at the equidistant point \eta_{12} on that geodesic. The Pythagorean relation (11.21) holds for x on the hyperplane: in general D_\varphi[x:\eta_i]-D_\varphi[x:\eta_{12}]-D_\varphi[\eta_{12}:\eta_i]=(\theta_{12}-\theta_i)\cdot(x-\eta_{12}), which vanishes when an e-direction (\theta_{12}-\theta_i, along the e-geodesic from \eta_i) is orthogonal to an m-direction (x-\eta_{12}, in the hyperplane). The printed construction pairs two geodesics of the same kind.

Example and corrections (generalised KL, two centres).

Two panels of the same four-cell Voronoi diagram for the generalised KL divergence with the centre in the second slot. In the pattern coordinates the cell boundaries are straight lines, in the dual coordinates theta = log x they are curves. The geodesic between two centres that is straight in theta meets their boundary orthogonally at the equidistant point; the construction printed in the book gives a different curve, straight in theta.

1.4 The stochastic version: exponential families, soft k-means, priors (§11.1.5)

In plain words. A divergence can be turned into a probability: give a pattern the density \propto e^{-D_\varphi[x:\eta_h]}, high near the centre and decaying with the divergence. Theorem 11.3 says this is an exponential family whose natural parameter is the dual coordinate \theta_h of the centre. A cluster then becomes a distribution, a set of clusters a mixture, and fitting a mixture by maximum likelihood is the EM algorithm (the em algorithm of Chapter 8): the E-step computes the posterior probability of each cluster for each pattern (11.30), the M-step re-estimates the weights and centres. “Soft k-means” is this with the posterior probabilities as weights; “hard” k-means is its limit.

Corrections to the book’s statements.

1.5 Robust centres and total Bregman divergence (§11.1.6)

In plain words. One far-away outlier drags a mean arbitrarily far. The influence function z(x^*) is how much the centre of k patterns moves, times k, when one pattern x^* is added; a centre is robust if z stays bounded. The total Bregman divergence (Vemuri et al.) measures, instead of the vertical gap D_\varphi between the curve and its tangent, the perpendicular distance from the lifted point (x,\varphi(x)) to the tangent hyperplane: a steep tangent makes the same vertical gap a small perpendicular one.

Corrections to the book’s statements.

1.6 Error probability and Chernoff information (§11.1.7)

In plain words. Two classes with distributions p_1,p_2 from an exponential family; N patterns arrive from one of them and we must decide which. The best rule picks the class with the larger likelihood. Its error probability falls like e^{-NC}, and the rate C, the Chernoff information, is a divergence: \mathrm{KL}[\theta^*:\theta_i] from the point \theta^* where the e-geodesic between the two classes crosses the decision boundary to either class, the same number for both. Geometrically (Sanov, Chapter 3) the data summarise to the observed point \bar\eta, which is a random point near the true distribution; an error needs it to land on the wrong side of the boundary, which costs e^{-N\min\mathrm{KL}}, and the nearest point of the boundary is the foot of the perpendicular (Pythagoras).

Example. Poisson against Poisson with different rates, so \theta_i=\log\lambda_i and \psi(\theta)=e^\theta. The e-geodesic is \theta_t=(1-t)\theta_1+t\theta_2 and the equidistant point (11.51) is where the KL divergences to the two ends are equal; that common value is the Chernoff information C, which also equals -\min_t\log\sum_xp_1^{1-t}p_2^t.

Remarks.

Left: minus the logarithm of the exact Bayes error divided by N against N for two Poisson laws, for equal priors and for lopsided priors; both curves decrease towards the Chernoff information from above. Right: along the e-geodesic between the two distributions the KL divergence to each end crosses at the equidistant point, where the Chernoff function (minus the log of the sum of p1 to the 1 minus t times p2 to the t) reaches its maximum.

2. Support vector machines (§11.2)

2.1 The linear machine, margin and dual (§11.2.1)

In plain words. If two classes of points in the plane can be separated by a line at all, many lines will do; the support vector machine picks the one with the widest empty corridor, the margin. The points that touch the corridor are the support vectors: they alone decide the line. The calculation of the widest corridor is a quadratic optimisation with a dual form in which the data enter only through inner products x_i\cdot x_j; replacing these by a kernel is the “kernel trick” (§2.2).

Remarks (a small separable set; the dual (11.71)–(11.72) solved by a simple SMO routine of my own).

2.2 Kernels (§11.2.2–11.2.3)

In plain words. A kernel K(x,x')=z(x)\cdot z(x') is an inner product after an embedding z into a feature space, possibly infinite-dimensional. Any function that behaves like an inner product (“positive semi-definite”) is a kernel (Mercer), and then the embedding can be recovered from its eigenfunctions.

Remarks.

2.3 The metric induced by a kernel (§11.2.4)

In plain words. The embedding x\mapsto z(x) draws the pattern space as a curved sheet in feature space; the length of a short step on the sheet is the length in feature space of its image. That defines a Riemannian metric on the pattern space, g_{ij}=\partial_iz\cdot\partial_jz (11.89), which can be computed from the kernel alone, g_{ij}=\partial^2K(x,x')/\partial x_i\partial x'_j|_{x'=x} (11.90), and a volume element \sqrt{\det g}\,dx (11.91) saying how much the embedding stretches volume at x.

Examples. For K=(x\cdot x'+1)^2 on \mathbb R^2 the 6-dimensional embedding is explicit, the metric from its Jacobian equals the one from the mixed second derivative of K, and both equal the closed form 2(\lvert x\rvert^2+1)I+2xx^{\mathsf T}. The Gaussian kernel has g=\frac2{\sigma^2}I at every point: the feature manifold of the Gaussian kernel is intrinsically flat, with constant volume element, although it sits curved in the Hilbert space. The embedding (11.78) has g=I+4xx^{\mathsf T}, with volume element \sqrt{1+4\lvert x\rvert^2}, equal to \sqrt{\det g}.

2.4 The conformal change of a kernel (§11.2.4)

In plain words. The decision of an SVM is made in the neighbourhood of the support vectors, so one wants the feature space to stretch there. Multiply the kernel by a position-dependent factor, \tilde K(x,x')=\sigma(x)\sigma(x')K(x,x'): the new feature vectors are \sigma(x)z(x), longer where \sigma is large. The new metric is (11.95), and for kernels with \partial_{x_i}K(x,x')|_{x'=x}=0, such as the Gaussian, simply \tilde g=\sigma^2g+\nabla\sigma\nabla\sigma^{\mathsf T}K(x,x) (11.98). The book proposes \sigma=\sum_ie^{-\kappa_i\lvert x-x_i^*\rvert} (11.93), large near the support vectors x_i^*, retraining with the new kernel, and reports improvements “up to ten percent”.

Remarks.

Left: the decision boundaries f = 0 of a Gaussian-kernel SVM trained on noisy-circle points, before and after the conformal modification of the kernel; the support vectors are the larger dots and the dashed circle is the true class boundary. Right: the paired change in test error over repeated runs for three values of kappa, with error bars: a slight rise, a slight fall and a clear rise.

3. Stochastic reasoning: belief propagation and CCCP (§11.3)

3.1 Graphical models, mean field and the m-projection (§11.3.1–11.3.2)

In plain words. Many random \pm1 variables interact through small factors: q(x)\propto\exp\{h\cdot x+\sum_rc_r(x)\}, where each c_r depends only on the variables of one clique (a group of variables all linked to one another). Given such a q one wants the marginals \eta_i=\mathbb E[x_i], but summing over 2^n states is out of reach for large n. The independent distributions M_0=\{e^{\theta\cdot x-\psi}\} (each spin has E[x_i]=\tanh\theta_i, (11.114)) form an e-flat family. Two ways to approximate q by an independent one: the m-projection (minimise \mathrm{KL}[q:p] over p\in M_0), which keeps the means exactly (Theorem 11.6, since the gradient of \mathrm{KL}[q:p_\theta] is \mathbb E_{p_\theta}x-\mathbb E_qx) and is therefore the thing we want but cannot compute; and the e-projection (minimise \mathrm{KL}[p:q]), which is cheap and is the mean field approximation (11.125).

Remarks.

3.2 Belief propagation as projections (§11.3.3)

In plain words. For each clique r take the model M_r that keeps the real interaction c_r of that clique and replaces all other interactions by a linear field \theta_r\cdot x (11.127). This is easy to project onto M_0 by matching means. The algorithm: (i) m-project each p_r(\theta_r) onto M_0, obtaining \tilde\theta_{0r}; (ii) the belief of clique r is what it adds beyond its own field, \xi_r=\tilde\theta_{0r}-\theta_r (11.134); (iii) the new independent model is the sum of all the beliefs, \theta_0=\sum_r\xi_r; (iv) the new \theta_r is that sum without clique r’s own belief (11.135)–(11.136). Each clique is told what all the others think and reports what it adds: the usual message-passing idea.

A remark. The conventional algorithm (11.140)–(11.141) sends messages m_{ki}(x_i) along edges; in log-odds form u_{k\to i}=\frac12\log\frac{m_{ki}(+1)}{m_{ki}(-1)} and, for a pair interaction w, u_{j\to i}=\operatorname{atanh}\{\tanh w\tanh(h_j+\sum_{k\ne i}u_{k\to j})\}. Running the geometric algorithm literally (m-projection by listing all states) beside the message passing, from the same start, the two give the same beliefs at every step, and the belief \xi_r^t of clique r at node i equals the message u_{j\to i}: the correspondence (11.142)–(11.143) is exact, step by step.

3.3 The solution: e- and m-conditions, trees, accuracy (§11.3.4)

In plain words. At a fixed point, every clique model has the same means as the independent model (the m-condition, nothing left to match), and the fields add up consistently, (L-1)\theta_0=\sum_r\theta_r (the e-condition), which says exactly that q itself lies on the e-flat hull E^* through all the p_r^* and p_0^* (for q is the product of the p_r divided by p_0^{L-1}, up to normalisation). If in addition the m-flat hull M^* of those points contains q, the m-projection of q onto M_0 is the fixed point, and BP is exact.

Remarks.

3.4 CCCP (§11.3.5)

In plain words. BP is known to look for stationary points of a free energy, the Bethe free energy F (Yedidia et al.), but it is not a descent method and may fail to converge. The convex–concave procedure (Yuille) writes F=F_{\rm vex}+F_{\rm cave} and iterates \nabla F_{\rm vex}(z^{t+1})=-\nabla F_{\rm cave}(z^t): each step minimises a convex surrogate, which makes F decrease at every step, so it converges. The book’s geometric version (11.144)–(11.145) does the opposite of BP: choose (\theta_0,\theta_r) so that the m-condition holds (the “inverse m-projection” of p_0(\theta_0^t) to every M_r) and then correct \theta_0^{t+1}=\sum_r(\theta_0^t-\theta_r^t) towards the e-condition; Yuille’s original (11.148)–(11.149) uses the new \theta_r^{t+1} on the right and so has an inner loop. The book calls the geometric version “simpler” and says CCCP “always converges” (p. 257, and again for Yuille’s version on p. 260).

What each iteration is. For a pair interaction, the inverse m-projection onto one edge is closed-form (a quadratic for the pair correlation), so both versions can be run on the four-cycle. Writing \Theta_i=\operatorname{atanh} of the node mean, the simplified step is \Theta_i^{t+1}=h_i+\sum_{r\ni i}(\Theta_i^t-a_{r,i}^t) with a_{r,i}^t the node field of the two-spin model of edge r with the current means. Yuille’s step solves \Theta_i^{t+1}+\sum_{r\ni i}a_{r,i}(\Theta^{t+1})=h_i+d_i\Theta_i^t (a convex stationarity condition, solved by damped Newton), so the simplified one is one Picard step of Yuille’s inner equation started from the current point. By my reading (derived by hand) Yuille’s is exactly CCCP on F_{\rm B}=[U-\sum S_{ij}-\sum_iS_i]+\sum_id_iS_i, a legitimate convex-plus-concave split of the Bethe free energy (with U the energy, S_{ij}, S_i the entropies of pair and node beliefs and d_i the degree).

Remarks (four-cycle, same kind of fields as above).

Left: the largest error of the belief propagation marginals and of the mean-field marginals against the exact ones on a four-spin cycle, as the coupling grows; belief propagation stays below mean field. Right: the belief of one spin over forty iterations at a strong coupling for the simplified CCCP, which oscillates between two far-apart values, for Yuille's CCCP, which creeps monotonically towards the BP fixed point, and for BP itself; the exact marginal is a different value again.

4. Information geometry of boosting (§11.4)

In plain words. Boosting builds a strong classifier F=\sum_a\alpha_ah_a from weak ones h_a (each only slightly better than a coin toss), adding them one at a time. Each new weak machine is trained on the examples the current machine gets wrong, the weights W_t(x_i)\propto e^{-y_iF_t(x_i)} of the examples being what the book calls the distribution of losses; the weight \alpha of the new machine is chosen as best possible. The geometry: W_t is the member with parameters (\alpha_1,\dots,\alpha_t) of an exponential family on the training examples, and the choice of \alpha is a projection.

The AdaBoost formulas. Setting the derivative of \sum_ie^{-y_i(F_t(x_i)+\alpha h(x_i))} to zero gives (11.170); with \varepsilon the weighted error of the new machine, -\varepsilon e^{\alpha}+(1-\varepsilon)e^{-\alpha}=0 (11.173), so \alpha=\frac12\log\frac{1-\varepsilon}\varepsilon (11.174), and the weights update by W_{t+1}\propto W_te^{-\alpha yh} (11.175).

Remarks (a small set of training points in the unit square with a family of decision stumps; exact weights, no resampling).

Left: the weight alpha of each of the boosting rounds as computed by AdaBoost, one half log of one minus epsilon over epsilon, against the weight given by exact maximum likelihood for the normalised model: at the first round the latter is exactly twice as large. Right: the training error and the product of the normalisers Z_t, which equals the mean exponential loss, over the rounds; the error stays below the product at every round and reaches zero after a few rounds.

5. Bayesian inference and deep learning (§11.5)

5.1 Bayesian duality and conjugate priors (§11.5.1)

In plain words. For an exponential family p(x\vert\theta)=e^{\theta\cdot x-\bar k(x)-\psi(\theta)} put a prior \pi(\theta) on the parameter. The joint law is p(x,\theta)=e^{\theta\cdot x-\bar k(x)-\bar\psi(\theta)} with \bar\psi=\psi-\log\pi (11.178)–(11.179): symmetric in the roles of x and \theta. Conditioning on \theta gives the exponential family with natural parameter \theta; conditioning on x gives the posterior (11.180), also an exponential family, now in the random variable \theta with natural parameter x and its own log-partition function k(x). The expectation parameters are \eta=\mathbb E_\theta[x] and \theta^*=\mathbb E_x[\theta] (11.183)–(11.184). A conjugate prior is one of the same shape as the posterior, so that Bayes’ rule is just an update of two hyperparameters.

Remarks.

5.2 The restricted Boltzmann machine and learning as em (§11.5.2–11.5.3)

In plain words. A restricted Boltzmann machine (RBM) has a visible layer v and a hidden layer h of binary units, interactions only between the layers, and the stationary law p(v,h;W)=e^{h^{\mathsf T}Wv-\psi(W)} (biases dropped). Given the data law q(v) one wants W to minimise \mathrm{KL}[q:p_V], the m-projection of q onto the manifold M_V of visible marginals. Since the hidden units are never observed this is exactly the hidden-variable problem of Chapter 8: put the data on the extended manifold M_{V,H\vert q}=\{q(v)r(h\vert v)\} and the model on M_{V,H}=\{p(v,h;W)\} and alternate an e-projection (fill in h by r=p(h\vert v)) and an m-projection (refit W): the em algorithm.

Remarks (a small RBM; all its states can be listed).

5.3 The natural-gradient remark (end of §11.5.3)

The book remarks that the natural gradient would work better if one had an algorithm for it, and suggests mixed coordinates. For an RBM the ingredients are all computable on a small machine. Write G_{\rm joint}=\mathrm{Cov}_p(h_iv_j,h_kv_l) for the Fisher information of the joint exponential family (natural parameters W) and G_V for that of the visible marginal. Since \nabla_W^2\log p_V(v)=\mathrm{Cov}_{h\vert v}(hv^{\mathsf T})-G_{\rm joint}, the Hessian of \mathrm{KL}[q:p_V] is G_{\rm joint}-\mathbb E_q\mathrm{Cov}_{h\vert v}(hv^{\mathsf T}). What this gives:

5.4 The geometry of contrastive divergence (§11.5.4)

In plain words. The learning rule needs \langle hv^{\mathsf T}\rangle_p under the model’s own stationary law, which needs a long Markov chain. Contrastive divergence (\mathrm{CD}_k) replaces it by the average after only k rounds of Gibbs sampling started from the data: v_0\sim q, then alternately h\sim p(h\vert v) and v\sim p(v\vert h). Geometrically (Karakida): p_j(v,h)=p_{V,j}(v)p(h\vert v) lives on the e-flat family M_{H\vert V}=\{r(v)p(h\vert v)\}, the half-step \tilde p_{j+1}=p_{H,j}(h)p(v\vert h) on the e-flat family \tilde M_{V\vert H}=\{\tilde r(h)p(v\vert h)\}, and each Gibbs half-step is an m-projection onto the other family (Theorem 11.11); both families contain the model p, so the Pythagorean theorem splits the initial divergence into the sum of all the steps (Theorem 11.12).

Remarks.

5.5 The Gaussian RBM (§11.5.5, Theorem 11.13)

In plain words. If both layers are Gaussian the machine can be analysed exactly. Its stationary law (11.223) has the visible marginal p_V\propto\exp\{-\frac1{2\sigma_v^2}v^{\mathsf T}(I-W^{\mathsf T}W)v\} (11.226). Learning from data with covariance C drives W to a point where the model covariance \sigma_v^2(I-W^{\mathsf T}W)^{-1} equals C in the leading directions, so the machine does principal component analysis with a noise floor \sigma_v^2: directions with data variance below \sigma_v^2 cannot be modelled and are replaced by \sigma_v^2.

Remarks.

Left: on a small binary RBM, the terms of the Pythagorean decomposition of the KL divergence from p0 to p on a log scale: the first term is the largest, the later terms fall geometrically to rounding level, and their sum is the total KL divergence. Right: the singular values of the weight matrix of a Gaussian RBM trained by maximum likelihood, CD1 and CD3 flows, all converging to the same values, the square roots of one minus sigma v squared over lambda.

Checks of the book’s statements

These are the places where the printed text and my re-derivation disagree. The corrected statements are in the sections above.

Questions and doubts

Takeaways

Term One line
Bregman divergence D_\varphi[x:\eta]=\varphi(x)-\varphi(\eta)-\nabla\varphi(\eta)\cdot(x-\eta); =\mathrm{KL}[p_x:p_\eta] for an exponential family
centre of a cluster \arg\min_\eta\frac1k\sum D_\varphi[x_i:\eta]= mean (second slot); in the first slot the mean in \theta
cell boundary D_\varphi[x:\eta_1]=D_\varphi[x:\eta_2]\iff(\theta_2-\theta_1)\cdot x=\text{const}: flat in \eta, \perp the e-geodesic
soft k-means EM for the mixture \sum\pi_he^{-D_\varphi[x:\eta_h]}; M-step: weights \frac1N\sum p, centres \sum xp/\sum p
Chernoff information C=-\min_t\log\sum p_1^{1-t}p_2^t=\mathrm{KL}[\theta^*:\theta_1]=\mathrm{KL}[\theta^*:\theta_2]; P_{\rm err}\approx e^{-NC}
SVM margin 1/\lvert w\rvert; dual \sum\alpha-\frac12\sum\alpha_i\alpha_jy_iy_jK_{ij}, \alpha\ge0, \sum\alpha_iy_i=0; f=\sum\alpha_iy_iK(x_i,\cdot)+b
induced metric g_{ij}=\partial_i\partial'_jK|_{x'=x}; Gaussian kernel: \frac2{\sigma^2}\delta_{ij}; conformal: \tilde g=\sigma^2g+\nabla\sigma\nabla\sigma^{\mathsf T}K (K_i=0)
mean field / BP e-projection of q onto M_0 (\eta=\tanh(W\eta+h)) / alternating m-projection of M_r onto M_0 with \theta_0=\sum_r\xi_r
BP fixed point m-condition \mathbb E_r[x]=\mathbb E_0[x]; e-condition (L-1)\theta_0=\sum\theta_r (\iff q\in E^*); exact on trees
CCCP Yuille: inner loop, F decreases; simplified (11.144)–(11.145): one Picard step, unstable beyond \tanh w=\frac13 on the 4-cycle
AdaBoost \alpha=\frac12\log\frac{1-\varepsilon}\varepsilon, W_{t+1}\propto W_te^{-\alpha yh}, Z_t=2\sqrt{\varepsilon(1-\varepsilon)}, error \le\prod Z_t
Bayesian duality p(x,\theta)=e^{\theta\cdot x-\bar k(x)-\bar\psi(\theta)}: natural for \theta in x, for x in \theta; \theta^*=\partial k/\partial x; conjugate update (\alpha,\beta)\to(\alpha+N\bar x,\beta+N)
RBM learning \Delta W=\varepsilon(\langle hv^{\mathsf T}\rangle_q-\langle hv^{\mathsf T}\rangle_p)=-\varepsilon\nabla\mathrm{KL}[q:p_V]; em between M_{V,H\vert q} and M_{V,H}
\mathrm{CD}_k p_j, \tilde p_j alternating m-projections; \mathrm{KL}[p_0:p]=\sum_j\mathrm{KL}[p_j:\tilde p_{j+1}]+\sum_j\mathrm{KL}[\tilde p_j:p_j]
Gaussian RBM W\to U\operatorname{diag}(\sqrt{1-\sigma_v^2/\lambda_i})O; model covariance \sigma_v^2(I-W^{\mathsf T}W)^{-1} keeps \lambda_i and floors the rest at \sigma_v^2

Notes written 2026-10-02.