Maps to: UC Berkeley CS294-158 Deep Unsupervised Learning (Spring 2024), Lecture 4 · Thu 2/8/2024 · Latent Variable Models — Variational AutoEncoder (VAE), first part (slides 1–66): why latent variable models, the training objective, exact likelihood for few latent values, prior sampling and why it fails, importance sampling, the variational approach and amortized inference, IWAE, two derivations of the variational lower bound, likelihood-ratio vs pathwise (reparameterization) gradients on a toy problem, the VAE, and why it is called an autoencoder. Homework 2, Questions 1 and 2a. Basis: The slides derive several key formulas live on the board. These notes write the derivations out, then check each claim numerically on models whose answers are known: a 2-D mixture with an exact objective, noisy ShapeWorld (whose exact likelihood is a sum over all 921,600 latent configurations), and probabilistic PCA, whose likelihood and posterior are Gaussians in closed form. The homework’s VAEs run on 2-D Gaussians and on binary ShapeWorld, so that a VAE’s bits can be put next to the exact floor and to Lectures 3–6. Code:
code/lecture07/(5 scripts +lvm.py; PyTorch (CPU); seconds each, except the ShapeWorld VAEs of script 05: ~8 minutes on the first run, then cached) Reading time: 4 hours including running the code
0. How to read this lecture
0.1 Learning goals
After this lecture you should be able to:
- Explain what latent variable models offer (compact representations, faster sampling by exploiting structure) and what they cost (the likelihood becomes an integral).
- Train a latent variable model exactly when takes few values, and explain why prior sampling fails when it takes many.
- Use importance sampling to estimate , and explain why the ideal proposal is the posterior .
- Derive the variational lower bound (VLB / ELBO) by Jensen’s inequality and by the KL identity, and state its gap exactly: .
- Explain amortized inference and the IWAE bound.
- Derive the likelihood-ratio and pathwise gradient estimators, compare their variance, and say when each applies.
- Assemble a VAE, read its loss as “reconstruction + KL”, and explain when its latent is used and when it is ignored.
0.2 Prerequisites and scope
| Assumed | Introduced here | Developed later |
|---|---|---|
| Lectures 5–6 (flows: change of variables, variational dequantization) | latent variable models, prior / importance sampling, ELBO, IWAE | richer priors, hierarchical VAEs (Lecture 8) |
| Lecture 2 (maximum likelihood = KL) | amortized inference, likelihood-ratio and pathwise gradients | discrete latents, VQ-VAE (Lecture 8) |
| Lecture 1 (ShapeWorld’s latents: shapes, sizes, positions) | the VAE, posterior collapse in its simplest form | posterior collapse with powerful decoders, β-VAE (Lecture 8); bits-back coding (Lecture 21) |
0.3 Map
§1 why latent variable models ← (concepts)
§2 the objective; Scenario 1: exact sums ← code 01 (Part 1)
§3 Scenario 2: prior sampling, importance sampling ← code 01 (Parts 2-3), 02 (Part 1)
§4 the variational lower bound, its gap, amortization, IWAE ← code 02
§5 gradients: likelihood ratio vs pathwise ← code 03
§6 the VAE; why it is an autoencoder ← code 04, 05
§7 summary §8 pitfalls §9 exercises §10 further reading §11 next lecture
0.4 Notation
| Symbol | Meaning |
|---|---|
| latent (unobserved) variable; the prior | |
| decoder / likelihood | |
| the marginal likelihood (“evidence”) | |
| the true posterior | |
| , | a proposal / approximate posterior; with shared across : an encoder (amortized) |
| ELBO, VLB | |
| IWAE | , |
0.5 How the experiments are run
Continuous data are in nats per point, binary images in bits per image. Three test benches with exact answers: a 2-D mixture of 3 Gaussians; noisy ShapeWorld (Lecture 1’s world with every pixel flipped with probability 0.05: a latent variable model with 921,600 configurations, whose exact is a matrix product); and probabilistic PCA (, ), where and are Gaussians in closed form. Every script fixes its seeds; reruns print identical numbers.
1. Why latent variable models?
Autoregressive models and flows treat all random variables as observed. Latent variable models (LVMs) add variables we never get to observe. Why would we want more unknowns?
- Simpler, lower-dimensional representations. The slides’ example: a photo is described by “corgi, red and white, at (x, y); background: wood bench in a park” — a handful of high-level variables, not a million pixel values. An LVM promises to identify such hidden variables automatically.
- Faster sampling. Autoregressive models are slow because every pixel depends on every previous one. If pixels are (approximately) independent given a latent , then sampling is: draw , then all pixels at once.
- Sometimes we know the causal story. ShapeWorld is literally an LVM: = (shapes, sizes, positions) → rendering → . In general we don’t know the latents, and the most popular models assume little about them (a standard normal vector); how best to specify latent variables is still open.
An LVM must support the four operations of the slides: sample (, — easy), evaluate (hard), train (needs or a surrogate), and represent ( “its” — needs the posterior , also hard).
2. The objective, and Scenario 1: sum it exactly
The training objective is maximum likelihood with the latent summed (or integrated) out:
Scenario 1: takes a small number of values → the sum is tractable, and the objective is exact. The slides’ example is a mixture of 3 Gaussians with a uniform prior over components: — a log-sum-exp, differentiable, trainable by SGD. (One could also optimize the prior — “learning the prior” — as Lecture 8 does.)
Script 01, Part 1 trains mixtures with components on 3,000 points of a true 3-component mixture (truth on the test points 2.0610 nats):
| train NLL | test NLL | − truth | |
|---|---|---|---|
| 1 | 3.4749 | 3.4933 | +1.432 |
| 2 | 2.5908 | 2.5689 | +0.508 |
| 3 | 2.0749 | 2.0623 | +0.001 |
| 5 | 2.0722 | 2.0644 | +0.003 |
and the posterior is a soft cluster assignment (e.g. 0.968 / 0.032 for a point between two clusters).

Left: data and the fitted mixture. Right: the posterior responsibilities as colours (01_exact_and_sampled_likelihood.py).
Scenario 2: can take an impractical number of values — a continuous vector, or 100 binary properties ( configurations), or ShapeWorld’s 921,600 configurations — and we must approximate.
3. Scenario 2: sampling the latent
3.1 Prior sampling, and why it fails
The first idea: if takes many values, sample it,
and run SGD on that. The challenge (slides): with data in clusters, a uniformly sampled makes only of the terms useful; with 100 binary high-level properties, the probability that a sampled matches a given is . “When going to higher dimensional data, it becomes near impossible to be lucky enough that a sampled is a good match for a data point.”
Script 01, Part 2 makes this concrete on noisy ShapeWorld: = the clean image’s latents, = the clean image with each pixel flipped with probability 0.05. The exact of 200 noisy test images, summed over all 921,600 panel pairs, is 99.88 bits on average. The right latent has prior probability ~ — a prior sample equals it about once in 228,000 draws — and every wrong one costs bits per mismatched pixel:
| prior samples | estimated | mean error | worst error | images within 1 bit |
|---|---|---|---|---|
| 10 | 334.37 | −234.5 | −352.8 | 0% |
| 1,000 | 191.92 | −92.0 | −197.0 | 2% |
| 100,000 | 122.02 | −22.1 | −81.8 | 40% |
Even 100,000 prior samples underestimate by 22 bits on average. By Jensen’s inequality, : the prior-sampling estimate is biased downwards, worst exactly when the posterior is narrow relative to the prior — i.e. when the latent is informative, which is what we want.
3.2 Importance sampling
To compute when samples from are uninformative, sample from a proposal and reweight:
What is a good proposal for data point ? We want samples compatible with — the posterior . With it every importance weight equals
so one sample gives the exact answer, with zero variance. Script 01, Part 3 uses proposals on noisy ShapeWorld (, 20 repetitions per image):
| mean error of (bits) | std of one estimate | |
|---|---|---|
| 1 (the posterior) | −0.000 | 0.000 |
| 0.5 | +0.000 | 0.022 |
| 0.25 | −0.017 | 0.121 |
| 0.1 | −3.340 | 5.150 |
and script 02, Part 1 on probabilistic PCA (mean error in nats over 500 test points):
| samples | prior sampling: mean error | std | posterior proposal: error | std |
|---|---|---|---|---|
| 1 | −118.39 | 102.9 | +8e-16 | 2e-15 |
| 10 | −7.29 | 7.51 | +8e-16 | 7e-16 |
| 100 | −0.40 | 0.76 | +9e-16 | 3e-16 |
| 1,000 | −0.026 | 0.170 | +8e-16 | 2e-16 |
| 10,000 | −0.002 | 0.050 | +8e-16 | 2e-16 |
The issue (slides): it is not clear how to sample from — that is the hard problem itself.
3.3 The variational approach
The general principle of variational methods: we cannot use the we want, so we propose a parameterized distribution we know how to work with (here: sample from, and evaluate), and find the parameter setting that makes it as good as possible — e.g. as close as possible to in KL divergence. All quantities in the resulting objective are computable (§4).
3.4 Amortized inference
For every we would solve its own optimization for its own — not scalable to large datasets, and expensive for every new data point. Amortization: if the same inference problem is solved many times, train a neural network to solve it — an encoder , e.g. , shared by all . The slides’ trade-off: faster and a form of regularization, but not as precise (the “amortization gap”, §4.3).
4. The variational lower bound
4.1 Derivation 1: Jensen
For any distribution with the right support,
The inequality is Jensen’s ( is concave). This is the variational lower bound (VLB), or evidence lower bound (ELBO). It is an objective amenable to stochastic optimization: an expectation under , which we can sample.
4.2 Derivation 2: KL — now we know the gap
Start from the KL divergence between and the true posterior:
So
the same bound as Jensen’s, but now we know the gap: it is exactly the KL from to the true posterior. Two consequences (slides): the optimal is , at which point the bound is tight; and maximizing the ELBO over is the same as making close to the posterior, while maximizing it over pushes up (minus whatever gap remains). Training a generative model by maximizing is therefore VLB maximization over both.
Script 02, Part 2 checks the identity on probabilistic PCA, where everything is in closed form:
| proposal | ELBO | ELBO | KL |
|---|---|---|---|
| exact posterior | −4.8012 | 0.0000 | 0.0000 |
| best diagonal Gaussian (mean-field, per ) | −4.9723 | 0.1711 | 0.1711 |
| amortized linear encoder (trained by SGD) | −4.9843 | 0.1832 | 0.1832 |
| posterior mean, prior covariance | −61.4997 | 56.6985 | 56.6985 |
| the prior itself | −119.0939 | 114.2927 | 114.2927 |
(.) The identity holds to the last digit. The posterior here is correlated with standard deviations 0.111 and 0.456 (the prior’s is 1): a diagonal cannot represent the correlation and pays 0.17 nats; the right mean with the prior’s width pays 57; the prior itself pays 114 — the single-sample prior-sampling error of §3.2.
4.3 Amortization and IWAE
The amortization gap is the difference between the best per data point and the best an encoder can produce: here the linear encoder lands 0.012 nats behind the per-example mean-field optimum (the posterior mean is linear in in this model, so amortizing costs little; with nonlinear models and small encoders the gap can be large).
The importance-weighted autoencoder (IWAE; Burda et al., 2015) uses samples inside the log:
and as . It is importance sampling (§3.2) with a learned proposal, read as a bound. Script 02, Part 3 (gap in nats):
| proposal | 5 | 50 | 500 | 5,000 | |
|---|---|---|---|---|---|
| best diagonal Gaussian | 0.181 | 0.061 | 0.011 | 0.0026 | 0.0007 |
| the prior | 115.9 | 16.7 | 0.889 | 0.060 | 0.003 |

More samples help; a good proposal helps far more.
5. Gradients through an expectation
The ELBO is with in the distribution we sample from. Differentiating with respect to (inside ) is easy; with respect to it is not. Two estimators.
5.1 Likelihood ratio (score function, REINFORCE)
It needs only values of — may be non-differentiable, may be discrete — and subtracting any constant baseline keeps it unbiased (). Its issue: high variance; many samples of are needed for a good estimate. (This is the estimator of policy gradients in reinforcement learning, where no assumption on is made.)
5.2 Pathwise derivative (reparameterization trick)
Write the sample as a differentiable function of fixed noise, — for a Gaussian , ; any flow from Lectures 5–6 would do — then
It requires continuous and differentiable, and “can work with only 1–2 samples”.
5.3 The toy problem
The slides’ toy problem: move in 2-D so that its samples reach a green point , i.e. minimize (we learn from , fixed; exact gradient ). Script 03, Part 1 (2,000 estimates each):
| samples | estimator | mean | std per component |
|---|---|---|---|
| 1 | likelihood ratio | (−7.51, −5.55) | (54.4, 51.7) |
| 1 | likelihood ratio + baseline | (−8.51, −5.83) | (13.4, 11.7) |
| 1 | pathwise | (−7.98, −5.99) | (1.03, 0.98) |
| 100 | likelihood ratio | (−8.04, −6.28) | (5.38, 5.27) |
| 100 | pathwise | (−8.00, −6.00) | (0.10, 0.10) |
Both are unbiased; the likelihood ratio’s single-sample noise is ~50× the pathwise one (and still 1–13× the gradient after a baseline). SGD with one sample per step, learning rate 0.02 (Part 2, median distance to over 20 runs):
| estimator | step 0 | 25 | 50 | 100 | 300 |
|---|---|---|---|---|---|
| likelihood ratio | 5.00 | 2.06 | 0.57 | 0.29 | 0.24 (1 of 20 runs diverged) |
| likelihood ratio, lr 0.002 | 5.00 | 4.70 | 4.41 | 3.50 | 1.77 |
| likelihood ratio + running baseline | 5.00 | 1.83 | 0.71 | 0.16 | 0.12 |
| pathwise | 5.00 | 1.79 | 0.65 | 0.13 | 0.08 |

(Plan vs reality: the first version also learned ; with the likelihood-ratio gradient, received huge noisy updates and the runs diverged to NaN. Keeping fixed isolates the comparison.)
And the other side of the trade-off (Part 3): with a 0/1 cost — “is inside the disk of radius 0.5 around ?” — the pathwise gradient is zero almost everywhere and never moves (1.00 → 1.00), while the likelihood ratio, which only needs values, moves into the disk (1.00 → 0.03) — as long as some samples land in it (started 5 units away, no sample ever does and neither estimator moves). Discrete latents (Lecture 8’s VQ-VAE) need yet another trick, the straight-through estimator.
6. The variational autoencoder
6.1 Putting it together
With and , the pathwise estimator applies to the ELBO directly:
and stochastic gradients with respect to both and are one backward pass away. That is the Variational AutoEncoder (Kingma & Welling, 2014; Rezende et al., 2014). The slides’ comparison: likelihood-ratio gradients for the same objective are possible but need many samples (and wake-sleep, an older alternative, optimizes a different objective — Lecture 8’s extra material).
6.2 Why is it called an autoencoder?
Regroup the ELBO:
The first term is an autoencoder: (encoder) (decoder) , scored by how well is reconstructed. The second charges for the information the code carries: with Gaussians it is analytic, . In compression language (Lectures 1, 21), the ELBO is a code length: bits to describe (the KL) plus bits to describe given (the reconstruction).
6.3 Homework 2 Q1: when is the latent used?
The homework trains the same VAE — 2-D latent, diagonal Gaussian encoder, diagonal Gaussian decoder — on (a) a Gaussian with a full covariance and (b) a Gaussian with a diagonal covariance. Script 04 uses standard deviations 2.0 and 0.2, rotated by 45° for (a):
| (nats per point) | (a) full covariance | (b) diagonal covariance |
|---|---|---|
| −ELBO (10 draws of per point) | 1.9231 | 1.9145 |
| reconstruction term | −0.3798 | 1.9131 |
| KL | 2.3028 | 0.0015 |
| KL per latent dimension | 0.000 / 2.303 | 0.000 / 0.001 |
| IWAE, | 1.9163 | 1.9146 |
| truth (exact Gaussian, same points) | 1.9144 | 1.9144 |
Covariance of the decoder means , : in (a) [[1.98, 1.97], [1.97, 1.97]] — the data’s long axis (data: [[2.02, 1.98], [1.98, 2.02]]); in (b) essentially zero.

Rows (a), (b): test data, samples with decoder noise, decoder means without noise (04_vae_2d.py).
- (b): the latent is ignored (KL ≈ 0, “posterior collapse”). The decoder’s own diagonal Gaussian is the data distribution; information in would cost KL and buy nothing. Decoder means sit at one point; all variation comes from decoder noise.
- (a): the latent is used. A diagonal decoder cannot express the correlation, so the long axis of the data is routed through one latent dimension (2.3 nats); the second dimension is switched off. Decoder means trace the long axis; decoder noise supplies the thin direction.
- In (a) the bound is 0.009 nats loose (the encoder’s diagonal Gaussian is not the exact posterior) and IWAE closes most of it; in (b) the bound is tight (unused : = prior = posterior).
The general lesson, taken up in Lecture 8: a VAE uses its latent only for what its decoder cannot model by itself.
6.4 A VAE on ShapeWorld
Homework 2 Q2a trains a convolutional VAE with a 16-dimensional latent on colour images. Script 05 trains the same architecture on binary ShapeWorld with a Bernoulli decoder, so the ELBO is a bound in bits, directly comparable with the 17.80-bit floor and with every model so far (4,000 steps of 64 images, latent sizes 4, 16, 64):
| latent dim | −ELBO (bits) | reconstruction | KL | active dims | IWAE | ||
|---|---|---|---|---|---|---|---|
| 4 | 113.72 | 98.50 | 15.23 | 4 of 4 | 112.75 | 112.27 | 112.02 |
| 16 | 66.23 | 29.23 | 37.00 | 16 of 16 | 63.68 | 61.74 | 60.97 |
| 64 | 66.41 | 30.20 | 36.21 | 15 of 64 | 62.50 | 60.77 | 59.95 |
(IWAE on 200 test images; “active” = average KL above 0.1 bits.)
- The ELBO is a code length with two parts. Four latent dimensions are too few: the code is cheap (15 bits) but reconstruction costs 98. With 16 dimensions, 37 bits of code buy a reconstruction of 29 bits. With 64 dimensions the total is the same, and 49 dimensions are switched off — their KL is zero because they buy no reconstruction. The KL term acts as an automatic dimension selector.
- The VAE sits between flows and autoregressive models. IWAE with lowers the bound by ~6 bits, to ~60–61 bits: far better than Lecture 6’s best flow (94.7, also a bound), far worse than the autoregressive models (18.8–22.3, exact).
- The autoencoder view. Reconstructions (decoder mean at , thresholded) are pixel-perfect for 23.3% of test images, with 5.4 wrong pixels per image on average: small and thin shapes are blurred away. Samples from the prior are shape-like blobs; none is a valid image (Bernoulli draws or thresholded means, or ; 24–28 pixel flips from the nearest valid image). Interpolating between the codes of two test images cross-fades — one shape dissolves while the other appears — rather than moving or morphing a shape.

Test images, reconstructions, samples (thresholded means), and an interpolation (05_vae_shapeworld.py).
Why so blurry? The decoder is factorized: given , every pixel is an independent Bernoulli. So every detail — which of 8 shapes, which of 4 sizes, which position — must be carried by , and a Gaussian is a smooth code for crisp, discrete facts: between two training codes the decoder must produce something, and it produces an average. Lecture 8 attacks exactly this: richer (learned, hierarchical) priors, discrete codes, and autoregressive decoders — the last of which brings its own problem, posterior collapse.
7. Summary
- Latent variable models explain data through unobserved variables: compact representations, sampling by ancestral steps. The price: .
- With few latent values, sum exactly (a 3-component mixture recovers the truth to 0.001 nats). With many, prior sampling is hopeless (22 bits too pessimistic with 100,000 samples on noisy ShapeWorld).
- Importance sampling with the posterior as proposal is exact from one sample; the art is to approximate the posterior — variationally, and amortized by an encoder.
- : the ELBO is tight iff is the posterior (checked to 4 decimals). IWAE tightens the bound with samples.
- Likelihood-ratio gradients need only values of but are noisy (~50× the pathwise noise here); pathwise gradients need differentiable and continuous , and work with one sample. The VAE uses the latter.
- The VAE = encoder + reparameterized sampling + decoder, trained on reconstruction − KL; it uses its latent only for what the decoder cannot do alone (homework 2 Q1: KL 2.3 nats vs 0.0015), and switches off latent dimensions it does not need (49 of 64 on ShapeWorld).
- On ShapeWorld a convolutional VAE reaches 66 bits (ELBO) / 61 bits (IWAE, ): better than flows (95), far worse than autoregressive models (18.8–22.3); reconstructions blur small shapes, samples are blobs, interpolations cross-fade.
8. Common pitfalls
- Reading a prior-sampling estimate as a likelihood. It is biased low, by many bits when the latent matters.
- Forgetting the normalizing constants of Gaussian decoders. They do not change gradients but change every reported number (script 02’s first version printed “−ELBO 7.2” for a true 4.9).
- Comparing an ELBO with an exact likelihood as if both were exact. The ELBO is a bound; report IWAE with large for a tighter (still lower) bound.
- Monte Carlo noise in the ELBO. A one-sample ELBO on a test set can be noisier than the effect being measured (script 04’s first version showed an “IWAE worse than the ELBO” by 0.0014 nats — two standard errors of a one-sample estimate).
- Likelihood-ratio gradients without a baseline. Unbiased but so noisy that SGD can diverge at learning rates where pathwise SGD converges.
- Interpreting KL ≈ 0 as a bug. It means the model found no use for ; whether that is a problem depends on what the latent is for (Lecture 8).
- Sampling binary images by thresholding the decoder mean and calling it the model’s sample. The model’s distribution is the Bernoulli draw; thresholded means are a different (usually prettier) object.
9. Exercises
Exercise 1 (exact objective). For a mixture , show that . Interpret.
Answer
. Each component is pulled towards in proportion to its responsibility for : the gradient of the exact objective already contains the posterior (the same quantity EM uses).
Exercise 2 (prior sampling is biased low). Show that for , and that the estimate is consistent as . For the 100-binary-property example, how many prior samples are needed before one matches with probability 1/2?
Answer
is unbiased for , so by Jensen ; by the law of large numbers and is continuous. A match has probability ; , so .
Exercise 3 (the zero-variance proposal). Show that with every importance weight equals . Why can’t we use this in practice?
Answer
. Using it requires sampling from and evaluating , which needs — the quantity we are trying to compute.
Exercise 4 (the ELBO two ways). Derive the ELBO with Jensen’s inequality and with the KL identity, and show that maximizing it over for fixed minimizes .
Answer
See §4.1–4.2. Since does not depend on , .
Exercise 5 (Gaussian KL). Derive . Which values of make dimension “free”?
Answer
. It is zero iff , : the encoder returns the prior for that dimension, whatever is — the dimension carries no information (an “inactive” dimension).
Exercise 6 (IWAE monotonicity). Show .
Answer
Upper bound: with is unbiased for ; Jensen gives . Lower bound: by concavity of , , whose expectation is . (Monotonicity in — — follows by writing the -sample average as an average of -sample averages; Burda et al., Theorem 1.)
Exercise 7 (the score function has mean zero). Show , and conclude that any constant baseline leaves the likelihood-ratio estimator unbiased. What is the variance-optimal constant baseline for a scalar parameter?
Answer
, so . Variance of with : minimize over : — roughly when and are weakly correlated.
Exercise 8 (pathwise for the toy problem). For and in dimensions, compute the pathwise estimator with one sample and its variance. Compare with the likelihood-ratio estimator’s variance at far from .
Answer
: mean , covariance — std per component for (script 03: 1.03, 0.98), independent of the distance to . Likelihood ratio: ; far from , , so std per component (script 03: 54, 52) — it grows with the size of , not just its slope; a baseline removes the constant part.
Exercise 9 (homework 2 Q1 reflection). Explain in two sentences why the VAE ignores its latent on the diagonal-covariance data and uses it on the full-covariance data. Would the answer change with a full-covariance decoder?
Answer
With diagonal data, the decoder’s own diagonal Gaussian (with constant in ) already equals the data distribution, so any information in costs KL without improving the reconstruction term; with correlated data, a diagonal decoder cannot express the correlation and the cheapest way to model it is to put the long axis into . With a full-covariance decoder, both datasets would be modelled exactly by the decoder alone and the latent would be ignored in both.
Exercise 10 (the ELBO is a code length). Interpret in bits as the length of a two-part code. Why does this code waste bits compared with , and how does “bits-back coding” (Lecture 21) recover them?
Answer
in bits: send using the prior (), then given ; the term is the subtlety. A naive two-part code pays , i.e. more than , because the choice of among the many plausible ones carries bits of arbitrary information. Bits-back coding uses those choice bits to transmit other data, getting them “back”, so the net cost is ; the remaining waste is the KL to the true posterior.
10. Further reading
From the slides
- D. P. Kingma, M. Welling. Auto-Encoding Variational Bayes, ICLR 2014.
- Y. Burda, R. Grosse, R. Salakhutdinov. Importance Weighted Autoencoders, ICLR 2016.
- G. E. Hinton, P. Dayan, B. J. Frey, R. M. Neal. The Wake-Sleep Algorithm for Unsupervised Neural Networks, Science 1995; P. Dayan, G. E. Hinton et al. The Helmholtz Machine, Neural Computation 1995.
Added by these notes
- D. J. Rezende, S. Mohamed, D. Wierstra. Stochastic Backpropagation and Approximate Inference in Deep Generative Models, ICML 2014 (the reparameterization trick, independently).
- R. J. Williams. Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning, 1992 (REINFORCE).
- C. Cremer, X. Li, D. Duvenaud. Inference Suboptimality in Variational Autoencoders, ICML 2018 (the amortization gap).
- S. Mohamed, M. Rosca, M. Figurnov, A. Mnih. Monte Carlo Gradient Estimation in Machine Learning, JMLR 2020 (a survey of both estimators).
- D. P. Kingma, M. Welling. An Introduction to Variational Autoencoders, Foundations and Trends in ML, 2019.
11. Next lecture
Lecture 8 (latent variable models II) asks what to put around the VAE’s Gaussian latent: richer priors (a learned hierarchical prior with a residual-normal posterior — homework 2 Q2b), discrete latents (VQ-VAE with a straight-through estimator and a Transformer prior over its codes — homework 2 Q3 — and the tokens of Lecture 4 seen as a VAE), posterior collapse when the decoder is powerful enough to ignore (a PixelCNN decoder) and its cures (weaker decoders, KL warm-up, free bits), and β-VAE, whose disentanglement can be measured on ShapeWorld because the true factors — shape, size, position — are known.