§13.0–13.3Linear Factor Models · Probabilistic PCA · ICA · Slow Feature Analysis

Part III DL pp. 489–495 · ~14 min read

  • linear factor model
  • factorial prior
  • probabilistic pca
  • factor analysis
  • independent component analysis (ica)
  • nonlinear ica
  • independent subspace analysis
  • topographic ica
  • slow feature analysis (sfa)
  • slowness principle

§13.0 Part III begins: probabilistic models with latent variables

Much of the research frontier of deep learning is about building a probabilistic model of the input, pmodel(x)p_{\text{model}}(\boldsymbol{x}). Such a model can, in principle, use probabilistic inference to predict any variable in its environment given any of the others. Most of these models carry latent variables h\boldsymbol{h}, with pmodel(x)=Ehpmodel(xh)p_{\text{model}}(\boldsymbol{x}) = \mathbb{E}_{\boldsymbol{h}}\, p_{\text{model}}(\boldsymbol{x} \mid \boldsymbol{h}) — the latents provide a distributed representation of the data, with all the advantages we saw representation learning bring to feedforward and recurrent nets.

This chapter starts Part III with the simplest such models: linear factor models. They were among the first latent-variable models to be studied extensively, they still serve as building blocks of mixture models (Hinton et al. 1995; Ghahramani & Hinton 1996; Roweis et al. 2002) and of larger deep probabilistic models (Tang et al. 2012), and they exhibit — in miniature — most of the design questions the advanced generative models of chapters 16–20 will face.

A linear factor model is defined by a stochastic, linear decoder: generate x\boldsymbol{x} by adding noise to a linear transformation of h\boldsymbol{h}. The data-generation recipe is:

The linear factor generative process (eqs 13.1–13.2)

hp(h)=ip(hi),x=Wh+b+noise\boldsymbol{h} \sim p(\boldsymbol{h}) = \prod_i p(h_i), \qquad \boldsymbol{x} = \boldsymbol{W}\boldsymbol{h} + \boldsymbol{b} + \text{noise}
p(h)=ip(hi)p(\boldsymbol{h}) = \prod_i p(h_i)a factorial prior — the explanatory factors are independent of one another, so sampling them is trivial (one draw per factor)d independent draws
W\boldsymbol{W}the factor loadings: column j says how factor hⱼ expresses itself across every observed dimensionn × d
b\boldsymbol{b}a bias — the mean of x when all factors are zeron
noise\text{noise}typically Gaussian and DIAGONAL (independent across the n dimensions) — everything the factors do not explainn

What this really says

A few independent hidden causes, mixed linearly, plus sensor noise. Every model in this chapter — factor analysis , probabilistic PCA, ICA — is exactly this recipe with a different answer to two questions: what distribution do the factors follow? and what does the noise look like? The simple joint distribution over h\boldsymbol{h} is the point: we want to discover explanatory factors whose interactions are easy to reason about.

Worked example — one draw from a linear factor model

Let d=2d=2 factors generate n=3n=3 observations, with W=[201102]\boldsymbol{W} = \begin{bmatrix} 2 & 0 \\ 1 & 1 \\ 0 & 2 \end{bmatrix}, b=0\boldsymbol{b} = \boldsymbol{0}. Sample the factors independently: h=[1.5,0.5]\boldsymbol{h} = [1.5,\, -0.5]^\top. Then Wh=[3,1,1]\boldsymbol{W}\boldsymbol{h} = [3,\, 1,\, -1]^\top; add a small noise draw [0.1,0.2,0.05][0.1,\, -0.2,\, 0.05]^\top to get x=[3.1,0.8,0.95]\boldsymbol{x} = [3.1,\, 0.8,\, -0.95]^\top. Note how x2=h1+h2x_2 = h_1 + h_2 mixes both causes — observing correlations among xix_i is how the model will infer the hidden factors.

The corresponding directed graphical model (§3.14) is the shared family portrait — every hih_i can influence every xjx_j, and the observed variables are conditionally independent given the factors:

Fig 13.1 (interactive) — the directed graphical model of the linear factor family: independent latent factors h generate x = Wh + b + noise. Probabilistic PCA, factor analysis and ICA differ only in the choice of prior p(h) and noise. Click a node to highlight the factors that mention it.
h₁h₂h₃x₁x₂x₃
p(h,x)=p(\boldsymbol{h}, \boldsymbol{x}) = ip(hi)  (factorial prior)\textstyle\prod_i p(h_i)\ \ \text{(factorial prior)}p(xh): x=Wh+b+noisep(\boldsymbol{x} \mid \boldsymbol{h}):\ \boldsymbol{x} = \boldsymbol{W}\boldsymbol{h} + \boldsymbol{b} + \text{noise}

click a node to see which factors mention it

§13.1 Probabilistic PCA and factor analysis

Probabilistic PCA , factor analysis and other linear factor models are all special cases of eqs 13.1–13.2 that differ only in the noise distribution and the prior over h\boldsymbol{h}.

In factor analysis (Bartholomew 1987; Basilevsky 1994) the prior is the unit Gaussian, and each observed xix_i gets its own noise variance:

Factor analysis (eqs 13.3–13.4)

hN(h;0,I),xN(x; b, WW+ψ)\boldsymbol{h} \sim \mathcal{N}(\boldsymbol{h};\, \boldsymbol{0}, \boldsymbol{I}), \qquad \boldsymbol{x} \sim \mathcal{N}\big(\boldsymbol{x};\ \boldsymbol{b},\ \boldsymbol{W}\boldsymbol{W}^{\top} + \boldsymbol{\psi}\big)
N(h;0,I)\mathcal{N}(\boldsymbol{h}; \boldsymbol{0}, \boldsymbol{I})unit-variance Gaussian prior on the factors — chosen because it keeps every downstream computation in closed formprior
WW\boldsymbol{W}\boldsymbol{W}^{\top}the covariance CONTRIBUTED BY the shared latent factors — this is the only place cross-variable dependencies come fromn × n, rank ≤ d
ψ=diag(σ2)\boldsymbol{\psi} = \mathrm{diag}(\boldsymbol{\sigma}^2)per-variable noise variances σ²₁ … σ²ₙ — the x_i are conditionally independent given h, so ψ is diagonaln × n diagonal
xN()\boldsymbol{x} \sim \mathcal{N}(\cdots)marginalizing the Gaussian latents out of a linear-Gaussian model leaves x exactly multivariate normalclosed form

The latents own the correlations; ψ mops up the rest

Every off-diagonal entry of the covariance of x\boldsymbol{x} comes from WW\boldsymbol{W}\boldsymbol{W}^{\top} — from factors shared between variables. The diagonal noise ψ\boldsymbol{\psi} can only add per-variable scatter. So the role of the latent variables is precisely to capture the dependencies between the observed xix_i: whatever co-varies must do so through the factors.

Worked example — one factor, two sensors

W=[2,1]\boldsymbol{W} = [2,\, 1]^\top (one factor, two sensors), ψ=diag(0.25,0.25)\boldsymbol{\psi} = \mathrm{diag}(0.25,\, 0.25). Then WW=[4221]\boldsymbol{W}\boldsymbol{W}^{\top} = \begin{bmatrix} 4 & 2 \\ 2 & 1 \end{bmatrix} and the marginal covariance is [4.25221.25]\begin{bmatrix} 4.25 & 2 \\ 2 & 1.25 \end{bmatrix}. The off-diagonal 22 exists only because both sensors watch the same factor — the implied correlation is 2/4.25×1.250.872 / \sqrt{4.25 \times 1.25} \approx 0.87, even though the noise on the two sensors is completely independent.

To cast PCA in this probabilistic framework, make one small change: force all the conditional variances to be equal, a single scalar σ2\sigma^2:

Probabilistic PCA (eqs 13.5–13.6)

xN(x;b, WW+σ2I)x=Wh+b+σz\boldsymbol{x} \sim \mathcal{N}\big(\boldsymbol{x};\, \boldsymbol{b},\ \boldsymbol{W}\boldsymbol{W}^{\top} + \sigma^2 \boldsymbol{I}\big) \qquad\Longleftrightarrow\qquad \boldsymbol{x} = \boldsymbol{W}\boldsymbol{h} + \boldsymbol{b} + \sigma \boldsymbol{z}
σ2I\sigma^2 \boldsymbol{I}ISOTROPIC noise — one shared residual variance instead of factor analysis's per-variable ψ. This is the entire difference between the two modelsscalar × I
zN(z;0,I)\boldsymbol{z} \sim \mathcal{N}(\boldsymbol{z}; \boldsymbol{0}, \boldsymbol{I})standard Gaussian noise, scaled by σ — the equivalent per-sample form of the same modeln
W,σ2\boldsymbol{W}, \sigma^2estimated together by an iterative EM algorithm (Tipping & Bishop 1999)learned

Most of the variance, up to a small residual

Probabilistic PCA bets that the latents capture most variation in the data, leaving only a small shared residual σ2\sigma^2. As σ0\sigma \to 0 it becomes classical PCA : the conditional expectation E[hx]\mathbb{E}[\boldsymbol{h} \mid \boldsymbol{x}] becomes an orthogonal projection of xb\boldsymbol{x} - \boldsymbol{b} onto the space spanned by the dd columns of W\boldsymbol{W} — exactly the projection you found by hand in the PCALab of §2.12.

But the limit has a sting. As σ0\sigma \to 0 the density concentrates ever more sharply around the dd-dimensional subspace spanned by W\boldsymbol{W}‘s columns — and any data point not near that hyperplane is assigned vanishingly low likelihood:

Fig — the σ → 0 limit of probabilistic PCA. The Gaussian density (pink contours) flattens onto the subspace spanned by W’s columns (dashed). A data point off the hyperplane keeps a reasonable likelihood at σ = 1, but as σ → 0 the “pancake” collapses to the line and that point’s likelihood goes to zero — a real failure mode when data does not cluster near a hyperplane.
σ = 1σ = 0.4σ → 0 (= PCA)p(x) ≈ 0 here!

§13.2 Independent component analysis (ICA)

Independent component analysis is among the oldest representation-learning algorithms (Hérault & Ans 1984; Jutten & Hérault 1991; Comon 1994; Hyvärinen 1999). Its goal: separate an observed signal into underlying signals that were scaled and added together — and make the recovered signals fully independent, not merely decorrelated (the crucial distinction of §3.8).

The variant closest to our generative framing (Pham et al. 1992) is fully parametric: the user fixes the prior p(h)p(\boldsymbol{h}) ahead of time, the model generates x=Wh\boldsymbol{x} = \boldsymbol{W}\boldsymbol{h} deterministically (no added noise), and a nonlinear change of variables (eq 3.47) yields p(x)p(\boldsymbol{x}) for maximum-likelihood training. Choosing an independent p(h)p(\boldsymbol{h}) is the lever: it forces the recovered factors to be as close to independent as possible.

This is used less for abstract causal factors than for low-level signal separation. Each training example is one moment in time; each xix_i is one sensor’s reading of the mixed signals; each hih_i is one recovered source. The classic cocktail-party problem: nn people speak simultaneously into nn microphones placed at different spots — ICA separates the voices so each hih_i contains one speaker, clearly. In neuroscience, EEG electrodes on the scalp record brain activity mixed with far stronger heartbeat and eye-blink artifacts; ICA separates the heart’s electrical signature from the brain’s, and brain regions from one another. Open the box and do the separation yourself:

The cocktail party (interactive) — two independent sources are mixed into two microphones. Whitening the mixtures fixes all second-order statistics, so every rotation θ of the whitened data is equally DEcorrelated — but only one rotation makes the channels INdependent. The Σ|kurtosis| score finds it; the Gaussian-sources toggle shows why a Gaussian prior makes the problem unsolvable.
true sources h (hidden from the algorithm)microphones x = A·h (all we observe)recovered ĥ = R(θ) · whitened x
correlation of ĥ₁, ĥ₂
0.000
≈ 0 at EVERY θ — whitening already decorrelates
Σ |excess kurtosis| (non-Gaussianity)
2.155
match to true sources
94.1%
best |corr(ĥᵢ, hⱼ)| pairing

Drag θ (or snap): whitening fixed the second-order statistics, so every rotation is equally decorrelated — but only one rotation makes the channels fully independent. The Σ|kurtosis| readout climbs as you approach it.

Beyond this variant, “ICA” names a whole family. Some members add generation noise; most drop maximum likelihood and instead directly push h=W1x\boldsymbol{h} = \boldsymbol{W}^{-1}\boldsymbol{x} toward independence. Since eq 3.47 needs det(W)\det(\boldsymbol{W}) — expensive and numerically unstable — many variants constrain W\boldsymbol{W} to be orthogonal. Two facts organize the family:

  • All variants require a non-Gaussian p(h)p(\boldsymbol{h}). With an independent Gaussian prior, W\boldsymbol{W} is not identifiable — many different W\boldsymbol{W} produce the same p(x)p(\boldsymbol{x}), because a rotated Gaussian is still the same Gaussian. This is the opposite of probabilistic PCA and factor analysis, which want Gaussian priors for their closed forms. In the maximum-likelihood approach the user typically picks p(hi)=ddhiσ(hi)p(h_i) = \frac{d}{dh_i}\sigma(h_i) — and such choices put larger peaks near 0 than a Gaussian, so most ICA implementations effectively learn sparse features.
  • Many variants are not generative models in our sense: they can transform between x\boldsymbol{x} and h\boldsymbol{h} but represent neither p(h)p(\boldsymbol{h}) nor p(x)p(\boldsymbol{x}). For instance, maximizing the sample kurtosis of h=W1x\boldsymbol{h} = \boldsymbol{W}^{-1}\boldsymbol{x} drives non-Gaussianity (as in the widget) without ever writing down a density — fine for ICA’s usual role as an analysis tool rather than a sampler.

Generalizations. Just as PCA generalizes to the nonlinear autoencoders of chapter 14, ICA generalizes to nonlinear ICA (Hyvärinen & Pajunen 1999), with successful ensemble-learning applications (Roberts & Everson 2001; Lappalainen et al. 2000). NICE (Dinh et al. 2014) stacks invertible encoder stages whose Jacobian determinants are cheap to compute, giving exact likelihood — and since the decoder is the encoder’s perfect inverse, sampling is as easy as drawing h\boldsymbol{h} and decoding. Relaxing full independence instead: independent subspace analysis allows dependence within non-overlapping feature groups while discouraging it between groups; and topographic ICA gives each unit a spatial coordinate with overlapping neighbor groups, so nearby units learn similar features. Trained on natural images, it learns Gabor filters whose neighbors share orientation, location or frequency — and pooling over each small region yields translation invariance, echoing the complex-cell story of §9.10.

§13.3 Slow feature analysis

Slow feature analysis (Wiskott & Sejnowski 2002) is a linear factor model that uses information from time signals to learn invariant features. It rests on the slowness principle : the important characteristics of a scene change slowly compared with the raw measurements describing it. Watch a zebra cross an image: any individual pixel flips black ↔ white rapidly as stripes pass over it, the feature “the zebra’s position” changes slowly, and “is a zebra present” does not change at all. So: regularize the model to learn features that change slowly.

The principle predates SFA (Hinton 1989; Földiák 1989; Mobahi et al. 2009; Bergstra & Bengio 2009) and can be added to any differentiable model trained by gradient descent, as a cost term:

The slowness penalty (eq 13.7)

λtL(f(x(t+1)), f(x(t)))\lambda \sum_t L\big(f(\boldsymbol{x}^{(t+1)}),\ f(\boldsymbol{x}^{(t)})\big)
λ\lambdahyperparameter setting how strongly slowness is enforced relative to the rest of the costscalar
ttthe index into a TIME SEQUENCE of examples — the principle only applies to temporal datasequence index
ffthe feature extractor being regularizedmodel
LLa distance between consecutive feature values — commonly the mean squared differenceloss

SFA is the especially efficient special case: apply the principle to a linear feature extractor f(x;θ)f(\boldsymbol{x}; \boldsymbol{\theta}), and the optimum has a closed-form solution — no gradient descent at all. (Like the non-generative ICA variants, SFA defines a map from input to feature space but no prior over features, hence no p(x)p(\boldsymbol{x}).) The problem:

The SFA problem (eqs 13.8–13.11)

minθ Et[(f(x(t+1))if(x(t))i)2]\min_{\boldsymbol{\theta}}\ \mathbb{E}_t\big[(f(\boldsymbol{x}^{(t+1)})_i - f(\boldsymbol{x}^{(t)})_i)^2\big]
Et[f(x(t))i]=0\mathbb{E}_t[f(\boldsymbol{x}^{(t)})_i] = 0zero mean (eq 13.9) — without it, adding any constant to a solution gives another solution with the same slowness: needed for UNIQUENESSconstraint
Et[f(x(t))i2]=1\mathbb{E}_t[f(\boldsymbol{x}^{(t)})_i^2] = 1unit variance (eq 13.10) — forbids the pathological "perfectly slow" solution where every feature collapses to the constant 0constraint
i<j,  Et[f(x(t))if(x(t))j]=0\forall i < j,\ \ \mathbb{E}_t[f(\boldsymbol{x}^{(t)})_i\, f(\boldsymbol{x}^{(t)})_j] = 0decorrelation (eq 13.11) — otherwise every learned feature would capture the SAME slowest signal; forces diversity, and is what makes the closed form possible (other diversification mechanisms, like reconstruction error, would lose it)constraint
f linearf\ \text{linear}the reason it all reduces to linear algebra — solvable exactly by a standard package, and the features come out ORDERED, slowest first (like PCA's components)model class

Three fences around a trivial optimum

The objective alone is minimized by any constant — total collapse. Unit variance fences that off; zero mean makes the answer unique; decorrelation stops feature #2 from being a copy of feature #1. What survives inside the fences is the slowest non-trivial, non-redundant direction — try to find it yourself below, then let the closed form snap to it.

The slowness principle (interactive) — two pixels flicker rapidly as a zebra's stripes pass, yet a slow scene factor hides in their correlations. Whitening enforces the zero-mean and unit-variance constraints for free; slide the remaining direction α to minimize 𝔼ₜ[(Δf)²] (eq 13.8), or snap to the closed-form SFA solution. The second feature would be the orthogonal direction (eq 13.11).
still fast
pixel x₁(t) — flickers as stripes passpixel x₂(t) — flickers as stripes passlearned feature f(t) = w·x (zero mean, unit variance)
SFA optimumfastslowfeature direction α — objective 𝔼ₜ[(f⁽ᵗ⁺¹⁾−f⁽ᵗ⁾)²]

Slowness 𝔼ₜ[(Δf)²] = 0.221 (optimum 0.009) · alignment with the true slow factor |corr| = 47%. This direction still passes stripe flicker through to f. Slide α (or snap): because SFA is linear, the slowest direction has a closed-form solution — no gradient descent needed.

Deep and nonlinear SFA. SFA learns nonlinear features by applying a nonlinear basis expansion first — commonly quadratic, replacing x\boldsymbol{x} with the vector of all products xixjx_i x_j — and then running linear SFA. Stacking (linear SFA → expansion → linear SFA → …) yields deep slow feature extractors. Trained on natural video patches, quadratic SFA learns features with the hallmarks of complex cells in V1 (Berkes & Wiskott 2005); trained on random 3-D camera motion, deep SFA learns features resembling the navigation cells of rat brains (Franzius et al. 2007) — a reasonably biologically plausible model.

A distinctive advantage: SFA’s output is theoretically predictable even in the deep nonlinear setting. Knowing how the environment’s underlying factors change (e.g. the distribution over camera position and velocity), one can solve analytically for the optimal features — and deep SFA experiments do recover the predicted functions, where most learning algorithms’ outcomes depend inscrutably on pixel-level details of the cost. It has also been used for object recognition and pose estimation (Franzius et al. 2008). Yet the slowness principle has powered no state-of-the-art application so far. One speculation: the prior is too strong — demanding features be approximately constant punishes the position of a fast-moving object, when what we really want is features that are easy to predict from one step to the next. An object’s position is useful whether its velocity is high or low.

Next: a linear factor model whose encoder is an optimization problemsparse coding, and the manifold view of PCA.

Check yourself — linear factor models, probabilistic PCA, ICA & SFA

1.What defines the linear factor model family?

2.The ONLY difference between factor analysis and probabilistic PCA is…

3.Why must p(h) be non-Gaussian for ICA to work?

4.Predict the outcome — in the ICALab, switch on "Gaussian sources" and sweep the rotation θ. What happens to the Σ|kurtosis| readout?

5.Predict the outcome — delete SFA's unit-variance constraint 𝔼ₜ[f²] = 1 (eq 13.10). What now minimizes the slowness objective?

6.What happens to probabilistic PCA as σ → 0?

6 questions