§20.9.1 REINFORCE — gradients through discrete samples
The reparametrization trick needs continuous . For a discrete sample, is a step function — derivatives are zero almost everywhere, so back-propagation gets no signal. But the expected cost is usually smooth, and its gradient has a tidy form:
The REINFORCE estimator (eq 20.62)
| the cost of a sampled outcome — used only as a scalar WEIGHT, never differentiated (so J may be a black box / non-differentiable) | scalar | |
| the score of the sampling distribution — differentiable w.r.t. the parameters ω, even when y itself is discrete | gradient | |
| an UNBIASED Monte Carlo estimate: draw samples y⁽ⁱ⁾, weight each score by its cost. Correlating good outcomes with high scores nudges ω toward them | average |
Cheap but noisy — the need for a baseline
REINFORCE reinforce A gradient estimator for DISCRETE stochastic operations: ∂E[J]/∂ω = E[J·∂log p(y)/∂ω], estimated by Monte Carlo; high variance, reduced with a baseline b(ω). defined in ch. 20 — open in glossary works by correlating which was sampled with how good turned out — but if a good is unlikely under the current parameters, it takes many samples to stumble on it, so the estimator has very high variance. The fix: subtract a baseline from . Because , any that doesn’t depend on leaves the gradient’s expectation unchanged (eqs 20.66–20.67) while shrinking its variance — often a learned estimate of the average cost.
| Method | When it applies | Character | |
|---|---|---|---|
| Reparametrization trick | reparametrization (§20.9) | CONTINUOUS y | low variance, exact pathwise gradient |
| REINFORCE | REINFORCE (score-function) | DISCRETE y (or non-differentiable J) | unbiased but high variance; needs a baseline |
§20.10 Directed generative nets
Within deep learning, directed models were long overshadowed by the RBM — until around 2013, when differentiable generators (VAEs, GANs) brought them to the fore.
§20.10.1 Sigmoid belief networks
A sigmoid belief network sigmoid belief network A directed generative model of binary units where each unit's probability is a sigmoid of its ancestors, p(sᵢ)=σ(Σⱼ<ᵢ Wⱼᵢsⱼ+bᵢ); efficient to sample but with intractable inference. defined in ch. 20 — open in glossary is a directed model of binary units, each a sigmoid of its ancestors:
The sigmoid belief network conditional (eq 20.70)
| input from the ANCESTORS (earlier units) — a directed acyclic structure, sampled ancestrally top-down | scalar | |
| each unit turns on with a sigmoid probability. Layered SBNs are UNIVERSAL approximators of distributions over the visibles | probability |
Sampling is cheap (one ancestral pass, top layer down), but inference is intractable (explaining away couples the latents, and mean field’s cliques span whole layers). The classic remedy is a learned inference net — the Helmholtz machine pairs an SBN with a network predicting the mean-field parameters, trained by wake-sleep. But the discrete latents block the reparametrization trick, so training leans on the noisier REINFORCE machinery (modern reweighted wake-sleep and bidirectional Helmholtz machines have made this practical). A special case with no latents is the fully-visible belief network (§20.10.7).
§20.10.2 Differentiable generator networks
The unifying modern idea: a differentiable generator network differentiable generator network A neural net g(z;θ) that maps latent samples z to data samples x (or to p(x|z)); the shared core of VAEs, GANs, and standalone generators. defined in ch. 20 — open in glossary — a neural net that transforms latent samples into data (or into ):
Formally is a nonlinear change of variables reshaping into :
Generator as a change of variables (eq 20.73)
| the density of the latent that maps to x — requires g to be invertible | density | |
| the Jacobian volume factor — usually intractable to evaluate, so we train g by INDIRECT criteria (VAE lower bound, GAN game) instead of max-likelihood on this formula | scalar |
A generator can either emit directly (continuous data only, but free of hand-designed output distributions) or emit the parameters of (e.g. sigmoid means of Bernoullis — handles discrete data). Either way, the reparametrization trick lets us train it by gradient descent. The two dominant instances — pairing with an inference net (the VAE) or with a discriminator (the GAN) — come next.
Check yourself — REINFORCE & differentiable generators
1.Why does the reparametrization trick fail for discrete samples, and what replaces it?
2.What is the main practical problem with the basic REINFORCE estimator, and how is it addressed?
3.What is the tradeoff of a sigmoid belief network?
4.What is a differentiable generator network, and why don't we train it by maximizing eq 20.73's change-of-variables likelihood directly?
5.A differentiable generator can either emit x directly or emit the parameters of p(x|z). What's the difference?