§20.6–20.9Convolutional & Sequential Boltzmann Machines · Back-Prop through Random Operations

Part III DL pp. 683–688 · ~3 min read

  • probabilistic max pooling
  • rnn-rbm
  • reparametrization trick

§20.6 Convolutional Boltzmann machines

Images strain any dense model, so — as in chapter 9 — replace matrix multiplication with convolution. Convolutional RBMs work well, but pooling is awkward in an energy-based model: a hard “pooling unit = maxidi\max_i d_i” over nn detectors would cost 2n2^n energy evaluations to normalize. Probabilistic max pooling (Lee et al. 2009) fixes this by constraining at most one detector active per region — so there are only n+1n+1 states (each detector on, or all off), and the pooling unit is on iff some detector is. It’s efficient, but forces the detectors to be mutually exclusive and forbids overlapping pooling regions, which limits accuracy versus supervised convnets.

Probabilistic max pooling. A pooling unit p sits over n detector units d; the constraint ”≤ 1 detector on” collapses the 2ⁿ configurations to just n+1 valid states, making the normalization tractable.
pd1d2d3at most one detector on

§20.7 Structured and sequential outputs

A Boltzmann machine can be made conditional — model p(yx)p(\boldsymbol{y}\mid \boldsymbol{x}) where the outputs y\boldsymbol{y} obey constraints (e.g. a coherent speech waveform), or a sequence p(x(t)x(t1),)p(x^{(t)}\mid x^{(t-1)},\ldots). A conditional RBM (Taylor et al. 2007) makes the RBM’s biases a linear function of the past mm frames; different histories switch different hidden units on, reshaping the distribution over the next frame. The RNN-RBM (Boulanger-Lewandowski et al. 2012) goes further: an RNN emits all of the RBM’s parameters (weights included) at each step — trained by back-propagating a contrastive-divergence gradient through time.

§20.8 Other Boltzmann machines

The framework is a rich, still-open space: discriminative RBMs maximize logp(yv)\log p(y\mid v) (best combined with the generative criterion); higher-order Boltzmann machines use energy terms that multiply more than two variables (three-way units can model video transformations, or gate features by a class label). Designing a new one is harder than adding a neural-net layer — you must find an energy function that keeps all the needed conditionals tractable.

§20.9 Back-propagation through random operations

Generative nets need to sample, but a sampling step seems to block gradients. The reparametrization trick dissolves the problem: pull the randomness out into an external input.

The reparametrization trick (eq 20.55)

yN(μ,σ2)y=μ+σz,zN(0,1)y \sim \mathcal{N}(\mu, \sigma^2) \quad\Longleftrightarrow\quad y = \mu + \sigma z, \quad z \sim \mathcal{N}(0, 1)
zN(0,1)z \sim \mathcal{N}(0,1)an external source of noise whose distribution does NOT depend on µ, σ — so it carries no gradientrandom input
y=μ+σzy = \mu + \sigma znow y is an ordinary DETERMINISTIC function of µ, σ (given z), so ∂y/∂µ = 1 and ∂y/∂σ = z flow through by back-propagationdifferentiable

Direct sampling from N(μ,σ2)\mathcal{N}(\mu,\sigma^2) is a stochastic node with no differentiable path to its parameters; rewriting it as y=μ+σzy=\mu+\sigma z makes it trainable. Toggle between the two views:

The reparametrization trick. In "direct sample" mode the stochastic node blocks the gradient — µ and σ can't be trained. Switch to "reparametrized" and the noise z becomes an external input, so y = µ + σz is a deterministic op whose gradients ∂y/∂µ = 1, ∂y/∂σ = z flow straight back to the parameters. This is what makes the variational autoencoder (§20.10.3) trainable.
z ∼ N(0,1)y = µ + σzµ=0.5
µσz×+y∂y/∂µ=1, ∂y/∂σ=z

The noise z is an EXTERNAL input (no gradient), so y = µ + σz is an ordinary deterministic function — gradients ∂y/∂µ = 1 and ∂y/∂σ = z flow straight back to the parameters.

More generally, any yp(yω)y \sim p(y\mid\omega) can be rewritten y=f(z;ω)y = f(z;\omega) (eq 20.57) with zz external — trainable as long as ff is continuous and differentiable, which requires yy continuous. For discrete yy the trick fails (a step function has zero gradient), and we need the REINFORCE estimator instead — next.

Check yourself — convolutional/sequential BMs & the reparametrization trick

1.How does probabilistic max pooling make pooling tractable in an energy-based model?

2.How does the RNN-RBM model a sequence?

3.Why can't back-propagation train the parameters of a directly-sampled y ∼ N(µ,σ²)?

4.What is the reparametrization trick, and why does it make sampling differentiable?

5.Predict the outcome — in ReparamLab you switch from 'direct sample' to 'reparametrized' mode. What changes in the computational graph?

5 questions