08 / 33 · Variational Autoencoders
VAE variants: β-VAE and VQ-VAE
Three ways to change a VAE: a weight on the KL term that sets how much the code may carry (β-VAE), a discrete code whose prior is learned afterwards (VQ-VAE and VQ-VAE-2), and, as optional depth, a flow decoder with an exact likelihood (VAPNEV).
On this page 11
The VAE ended with two complaints. Its samples are blurry, and its fixed Gaussian prior is only roughly matched by the codes the encoder actually produces, so prior samples can land where the decoder was never trained. This note follows three answers. The first keeps the model and changes the objective: a weight on the KL term decides how much information the code may carry. The second keeps the autoencoder and changes the code: a grid of discrete symbols from a learned codebook, with the prior fitted afterwards by a model strong enough to match them. The third keeps the Gaussian code and changes the decoder’s likelihood: an exact likelihood computed by a normalizing flow instead of a squared error summed over pixels.
Notation. As in the VAE note: an image , a code , an encoder , a decoder , a prior . is the stop-gradient operator: it returns its argument in the forward pass and has zero derivative in the backward pass. A codebook is a set of vectors .
Three ways to change a VAE#
The ELBO of one image has two terms:
The first term wants the code to say as much about as possible; the second charges for every bit it says. Changing their balance is the β-VAE. Changing what a code is, a continuous Gaussian or one symbol out of , is the VQ-VAE. The two are independent: one moves along a trade-off, the other changes where the difficulty of generation lives. A third change, an optional extension at the end of the note, keeps both terms and replaces the form of the reconstruction term itself, .
β-VAE: a weight on the KL term#
The β-VAE (Higgins et al., 2017) maximizes
is the plain VAE. For the objective is still a lower bound on , because it subtracts more of a non-negative quantity than the ELBO does; for it can exceed and is no longer a bound. In both cases changes which model training prefers, not only the scale of the loss.
Rate and distortion#
Averaged over the data, the two terms have names from information theory (Alemi et al., 2018). The rate is the average KL,
measured in nats. It bounds from above the mutual information between images and their codes under the encoder: the identity behind this, rate equals mutual information plus the KL from the aggregate posterior to the prior, is derived in the VAE note. The distortion is the average reconstruction loss. The negative ELBO is , and the β-VAE minimizes : the Lagrangian of “reconstruct as well as possible with at most a given rate”. Every picks one point of the trade-off; is the point that best bounds the likelihood.
Worked example: one latent dimension#
To see the trade-off with numbers, take one latent dimension, a standard normal prior and a fixed linear decoder with and . The data come from this very model, so . Holding the decoder fixed isolates what does to the encoder. Let the encoder be . For one the β-objective is, up to constants,
using and the closed-form KL to a standard normal from the VAE note. Setting the derivatives to zero,
gives the optimal encoder
At these are the mean and variance of the exact posterior , so the ELBO is tight. Averaging over gives the rate and the squared-error distortion :
| rate , nats | distortion | |||
|---|---|---|---|---|
| 0.25 | 0.976 | 0.024 | 1.89 | 0.025 |
| 1 | 0.909 | 0.091 | 1.20 | 0.100 |
| 4 | 0.714 | 0.286 | 0.55 | 0.376 |
| 16 | 0.385 | 0.615 | 0.13 | 1.032 |
Raising shrinks the code toward the prior: the mean is pulled to 0 and the variance grows toward 1, so the code says less about and the reconstruction gets worse. At the distortion, 1.03, is close to the variance of the data, 1.1: the code carries almost nothing. Lowering does the opposite and buys sharper reconstructions with a higher rate.
A high rate does not by itself mean a code far from the prior. The rate splits into the mutual information between images and codes plus the KL from the aggregate posterior to the prior. Here : at its variance is 1.071, and the mismatch is 0.001 of the 1.89 nats, so almost all of the rate is information about . Prior samples are poor when the aggregate posterior leaves the prior, or when the decoder is wrong where the prior puts mass. In this toy the decoder is fixed and equal to the true model, so changes only the encoder and samples decoded from the prior stay exact. In a jointly trained VAE a small also weakens the penalty on the mismatch, and that is how it can make prior samples worse.
β moves a VAE along the rate–distortion curve
What β buys and what it does not#
Higgins et al. (2017) report that makes individual latent coordinates track individual factors of variation (position, scale, rotation of a sprite), which they call disentanglement. A disentangled representation is one in which a single latent unit is sensitive to changes in a single generative factor while being relatively invariant to changes in the others (Section 1). Both halves matter: the unit must follow its factor, and it must change little when another factor changes. On CelebA faces with , single units turn the head, change the expression toward a smile or change the hair style while the rest of the face stays; in a plain VAE () the unit that turns the head also changes the expression, glasses and gender (Figure 1). Such a code would let us edit one feature at a time, reuse the factors for new tasks, reason about unseen combinations of known factors and notice inputs that fit no known combination (Section 1).
The mechanism is the pressure to spend little rate: a factorized prior is cheapest to match with a posterior whose coordinates are independent. weakens that pressure: it buys sharper reconstructions, and the objective favours a disentangled code even less. The effect of is not guaranteed either. Locatello et al. (2019) prove that without supervision or inductive biases disentanglement cannot be identified from data, and in a study of more than 12,000 trained models find that random seeds and hyperparameters matter more than the choice among disentangling objectives. Burgess et al. (2018) replace the fixed weight by a target rate that grows during training, , so that the code is allowed one more nat at a time. The useful reading of β-VAE is the one above: a dial on the rate, not a switch for interpretability.
VQ-VAE: a discrete latent code#
The VQ-VAE (van den Oord, Vinyals and Kavukcuoglu, 2017) gives up the continuous code. The encoder still outputs a map of vectors, , but each vector is replaced by the nearest entry of a learned codebook before it reaches the decoder:
The code of an image is the grid of indices : for the images below, 64 integers between 1 and 512 at the bottom level. In ELBO terms, the posterior is one-hot at , and with a uniform prior over the codes its KL is per position, a constant. The KL term drops out of training, and the VQ-VAE trains as a plain autoencoder with a quantized bottleneck.
Vector quantization: the nearest codebook vector
Training through the argmin#
The argmin has no useful gradient: a small change of either keeps the same or jumps to another. The VQ-VAE uses the straight-through estimator (Bengio, Léonard and Courville, 2013): in the forward pass the decoder receives , in the backward pass the gradient with respect to is copied to unchanged. In code it is one line, z_q = z_e + (z_q - z_e).detach(): the value is , the derivative is that of . The copy is a surrogate, not the derivative of quantization. Inside a cell the quantizer is constant, so its true Jacobian is zero; on a cell boundary it jumps. The straight-through estimator replaces that Jacobian by the identity, and this stays a substitution even when sits exactly on , where the true derivative is still zero. Closeness only makes the heuristic plausible: the decoder’s gradient, evaluated at , is then a reasonable guess for the direction in which to move . The loss has three terms:
summed over positions, with . The reconstruction term trains the decoder and, through the straight-through copy, the encoder. The codebook term moves toward the encoder output; it does not touch the encoder. The commitment term moves the encoder output toward ; it does not touch the codebook. Without it nothing stops the encoder outputs from drifting away from the codebook faster than the codebook can follow. The paper uses and reports that results are robust to it.
Worked example: one quantization step#
Take , , the codebook , , and one encoder output , the red point of the figure. The squared distances are
The nearest vector is , so the decoder receives and the code is the index 2. The codebook term is and the commitment term is : the same distance, with gradients sent in opposite directions. If the decoder’s loss has gradient with respect to , the encoder receives exactly at , plus the commitment gradient , which points from toward , so a descent step moves toward .
The codebook as online k-means#
The codebook term moves each toward the encoder outputs assigned to it, which is the update of k-means. The appendix of the VQ-VAE paper replaces it by exponential moving averages. For each code keep a count and a sum , update them with the outputs assigned to code in the batch,
with , and drop the codebook term from the loss. Each is then a running mean of its cell, exactly the k-means centroid computed online. With , (so ) and a batch of two outputs and assigned to it, the update gives , and : a small step toward the batch mean , as a moving average with should take.
The weak point of this scheme is the one k-means has: a code that no output selects receives no update and stays where it was initialized, a dead code. With many dead codes the effective codebook is small. Practical fixes restart unused codes at recent encoder outputs, as in Jukebox (Dhariwal et al., 2020), or look codes up in a low-dimensional, normalized space, as in ViT-VQGAN (Yu et al., 2022). Implementations often add a small constant to the counts (Laplace smoothing) to avoid dividing by zero for unused codes; this does not revive them.
Where the prior went#
Because the KL term is constant, training leaves the prior uniform, and sampling the codes independently and uniformly would give an image of random patches. The VQ-VAE therefore fits the prior after the autoencoder: encode the training set into grids of indices and train an autoregressive model on them, a PixelCNN in the paper, which predicts each index from the ones before it. Generation samples a grid from this prior and decodes it. The two-stage structure is the point of the method. The autoencoder handles the pixels, and the prior only has to model a grid that is tens of times smaller and made of symbols, where autoregressive models are strong; how they work is the subject of the autoregressive models note.
VQ-VAE-2: two levels of codes#
A single grid has to carry both the global layout and the fine texture. VQ-VAE-2 (Razavi, van den Oord and Vinyals, 2019) uses two: a coarse top grid for the layout and a finer bottom grid for detail that is quantized after seeing the top. For ImageNet at the grids are and with 512 codes each; FFHQ at uses three levels. The prior is hierarchical too: an autoregressive model over the top codes, with causal self-attention interleaved with its gated convolutions, and a conditional one over the bottom codes given the top, without attention to keep the larger grid affordable. The paper also filters samples with a pretrained ImageNet classifier, a rejection step that trades diversity for quality.
A small VQ-VAE-2: two code maps
How many bits#
The figure shows a small version for CIFAR-10 images: a top grid and an bottom grid, 512 codes each. An image is bytes, or 24,576 bits. Its code is indices of bits, or 720 bits, about 34 times fewer. Sampling cost scales the same way: an autoregressive model over raw subpixels needs 3072 sequential steps per image, the two priors need . At the paper’s scale the gap is subpixels against codes.
VAPNEV: a flow likelihood instead of pixel-wise reconstruction#
Optional depth: a flow decoder with an exact likelihood, and its conditional version. The rest of the note does not depend on it.
The changes above leave the decoder’s likelihood alone. With a factorized Gaussian decoder, is a squared error summed over pixels, and the best decoder output for a code is the average of all images that fit it: the blur of the VAE. VAPNEV (Agrawal and Dukkipati, 2016), an anagram of VAE-NVP, keeps the Gaussian code and the ELBO and replaces this term by an exact likelihood computed with a real NVP flow (Dinh, Sohl-Dickstein and Bengio, 2017) that is conditioned on the code. Flows are treated in full in the normalizing flows note later in the course; this section needs only the change-of-variables formula and the coupling layer, both restated here.
Notation. is an intermediate variable of the same size as the image. For every code , is an invertible map, a flow written in the course’s latent-to-data direction, with inverse . Agrawal and Dukkipati write the map in the data-to-latent direction.
The decoder likelihood as a change of variables#
The decoder network does not output an image. It outputs the mean and the variances of a Gaussian over , and the flow turns into the image:
By the change-of-variables formula, the likelihood of an image is exact (Section 3.1, Eqs. 10–11):
The ELBO keeps its form, with this term in place of the squared error:
The Gaussian now lives in the space of , not of pixels. The flow mixes pixels, so the model can represent dependencies between pixels for a given code, which a factorized Gaussian decoder cannot: it treats them as independent noise around one mean image. With the identity, the model is the ordinary VAE with a Gaussian decoder of learned variances. The formula also holds when the flow ignores ; the code then acts only through and (Section 3.1).
Conditional coupling layers#
The inverse map is a stack of conditional coupling layers (Section 3.2). As in an affine coupling layer, the input of a layer is split into two parts and ; the first passes unchanged, and the second is scaled and shifted by functions of the first. Here those functions also see the code (Eqs. 12–13):
For a fixed the Jacobian is still triangular, with , and the inverse is (Eqs. 14–15). Inverting needs the code, and the code is always known: from the encoder during training and from the prior during generation.
The scale combines a network of the unchanged part (two residual blocks in the paper) with a small transposed-convolution network that turns the low-dimensional code into a map of the same shape (Eq. 16):
The vectors , , and are learned per channel and broadcast over positions, and the shift is built the same way from its own pair of networks. The product term lets the code switch features of on and off, and the direct term gives every layer a shortcut to the code. The authors credit these shortcuts with strong conditioning and with good results from a flow with fewer layers.
Worked example: one exact likelihood evaluation#
A toy case with and a scalar code . One conditional coupling layer uses and , and the decoder outputs and . Take the image .
- Map to . . The layer computes and , so .
- Gaussian term. .
- Log-determinant. : the layer stretches the direction by , so the density of is times the density of .
- Total. nats.
Going back, : the layer is inverted exactly once is known.
Training, sampling and results#
- Training. The model maximizes the ELBO with Adam. The authors observed the KL term going to zero early in training, the posterior collapse of a decoder strong enough to model the images without the code, and countered it with the KL annealing of Bowman et al. (2016), Section 3.1: a weight on the KL term that starts at zero and grows to one during training (Section 3.3).
- Continuous data. A flow needs continuous inputs. The 8-bit images are dequantized with uniform noise (see the discrete-data callout), scaled to and mapped by with , and the bound is corrected by the log-Jacobian of this preprocessing so that it refers to the images themselves (Section 4.1). How flows are applied to images is covered in flow architectures.
- Sampling. Draw , then , and return (Section 3.4). A VAE’s decoder is a distribution too, but its samples for one code differ only by independent pixel noise, so usually only its mean is shown. Here the noise in passes through the flow, which mixes pixels, so one code gives different images; gives one image per code. Reconstruction does the same with from the encoder (Section 3.5).
- Architecture (Section 4.2). An 8-layer convolutional encoder and an 8-layer transposed-convolution decoder, a 256-dimensional code, and a multi-scale real NVP with 2 scales. Each scale has 3 conditional coupling layers with checkerboard masks and 3 with channel-wise masks, with 64 filters in the residual blocks of the first scale and 128 in the second.
Test results in bits per dimension (Tables 1–2; lower is better, and marks an upper bound from an ELBO):
| Model | CIFAR-10 | CelebA |
|---|---|---|
| PixelRNN | 3.00 | — |
| VAE with inverse autoregressive flow | — | |
| Real NVP | 3.49 | 3.02 |
| Convolutional DRAW | — | |
| VAPNEV |
On CIFAR-10 a VAE with one stochastic layer and this likelihood is roughly level with real NVP, which uses 8 residual blocks per coupling layer against 2, and its bound is slightly below that of convolutional DRAW, a VAE with several stochastic layers and recurrence. It stays behind autoregressive models and behind a VAE with a flow posterior. On CelebA it beats real NVP with 2 scales instead of 4 (Section 4.4). The reconstructions keep high-level content such as pose, background colour, hair colour and expression (Figures 3–4). The bits per dimension are those of the autoregressive models note.
Conditional VAPNEV#
Agrawal and Dukkipati suggest conditional density modelling as an extension but do not implement it (Section 5). The construction is that of the conditional VAE. For an image with a condition , for CelebA its 40 binary attributes, condition the encoder, , the decoder’s Gaussian, , and the coupling layers, whose code branch (and its shift counterpart) receives and together. Write the resulting flow and keep the prior . The bound becomes
Sampling fixes the attributes, draws from the prior, draws from the decoder’s Gaussian and returns . Changing one attribute while keeping asks for the same face with that attribute changed, to the extent that the code has not absorbed the attribute itself.
What changed#
| VAE | β-VAE | VQ-VAE / VQ-VAE-2 | VAPNEV | |
|---|---|---|---|---|
| Code | continuous, Gaussian | continuous, Gaussian | grid of indices into a codebook | continuous, Gaussian |
| Objective | ELBO | reconstruction − β · KL | reconstruction + codebook + commitment | ELBO with an exact flow likelihood |
| Role of the prior | fixed , enforced by the KL | the same, with weight | uniform during training; learned afterwards by an autoregressive model | fixed , enforced by the KL |
| Gradient through the code | reparameterization | reparameterization | straight-through copy | reparameterization |
| Sampling | decode | the same | sample codes autoregressively, then decode | decode to a Gaussian over , sample , apply the flow |
| Typical trouble | blur, prior holes | the rate–distortion trade-off itself | dead codes, slow sequential prior | KL collapse without annealing, a costly full-resolution decoder |
Limitations#
- β moves along a trade-off; it does not escape it. Lower distortion costs rate. Rate is mostly information about the image, not necessarily a mismatch with the prior; poor prior samples come from the aggregate posterior leaving the prior, which a small penalizes less. Disentanglement is a possible side effect, not a property of the objective.
- The straight-through gradient is a surrogate. It uses an identity Jacobian where the quantizer’s true derivative is zero, so it is never the exact gradient; the commitment term keeps near its codebook vector, which makes the substitution reasonable, not exact.
- Codebook collapse. Without restarts or a normalized lookup, a large share of the codes can go unused.
- Two-stage training. The prior is fitted to codes of a frozen autoencoder; errors of the first stage, such as a code grid that is hard to predict, cannot be fixed by the second.
- A flow decoder is strong and expensive. VAPNEV’s decoder can model the images without the code, so the KL term collapses unless it is annealed, and its flow works at full image resolution, which costs far more than a transposed-convolution decoder.
- Sequential sampling. The autoregressive prior samples one index at a time. Smaller than pixels, the grid is still sequential; later work replaces the prior by transformers over the same codes or by diffusion in a continuous latent space (latent diffusion).
Summary#
- β-VAE scales the KL term by and moves the model along the rate–distortion curve: gives a lower rate and worse reconstructions, the opposite. recovers the standard ELBO, maximizes a looser lower bound, and for the objective need not bound the likelihood.
- VQ-VAE replaces the Gaussian code by the nearest codebook vector. The KL becomes a constant, the argmin is crossed by the straight-through estimator, and the loss adds codebook and commitment terms, or an EMA update that makes the codebook an online k-means.
- The prior is learned after the autoencoder by an autoregressive model over the code grid. VQ-VAE-2 uses two grids, a coarse one for layout and a fine one for detail, and a prior for each.
- VAPNEV keeps the Gaussian code and the ELBO and replaces the pixel-wise reconstruction by the exact likelihood of a real NVP flow whose base Gaussian and coupling layers depend on the code. It needs KL annealing to keep the code in use. Its conditional version adds a label to the encoder, the decoder and the coupling layers.
Notebook#
The VQ-VAE part follows the VQ-VAE-2 notebook of the HSE-LAMBDA Deep Generative Models repository (cell numbers count every cell from 1). The notebook has no saved outputs, so it documents the procedure rather than results.
- Cell 6:
Quantizecomputes squared distances to all 512 codebook vectors at once with the expansion , a single matrix product, picks the nearest, updates the codebook with the EMA above (decay 0.99), returns the commitment distancediff = mean((quantize.detach() - input)²)and applies the straight-through estimatorinput + (quantize - input).detach(). The codebook is a buffer drawn from a standard normal, not a parameter, so Adam never touches it; it moves only through the EMA, and only in training mode. The counts are smoothed as with and , which keeps their total and makes every count positive. One issue: the counts start at while the sums start at the random codebook. After the first update, a code that the first batch did not select is therefore divided by a smoothed count of about , and its norm grows about times. It shrinks back only as , which takes about steps. In our own toy run of this update with standard-normal encoder outputs (not a notebook output), only 2 to 3 of the 512 codes were selected between steps 2 and 1000. Starting the counts at , so that the first quotient is the random codebook itself, avoids the jump. - Cells 7–10: architecture.
ResBlockis ReLU, a convolution from 128 to 32 channels, ReLU and a convolution back to 128, added to its input. The bottom encoder applies two stride-2 convolutions and a convolution, the top encoder one stride-2 convolution and a convolution, each followed by residual blocks; the decoders mirror this with a convolution, residual blocks and stride-2 transposed convolutions. The settings arechannel=128,n_res_block=2,n_res_channel=32, and codebooks of 512 vectors of dimension 64. The bottom encoder downsamples by 4 (to for CIFAR-10), the top encoder by 2 more (to ), and convolutions project the features to the 64-dimensional code vectors before quantization. The top code reaches the bottom level along two separate paths:dec_t, a small decoder, brings it back to to be concatenated with the bottom features and quantized as the bottom code, whileupsample_t, a single transposed convolution, enlarges it for the final decoder, which receives it together with the bottom code. - Cell 12: training minimizes the mean squared reconstruction error plus
diff, the commitment term; there is no codebook term because the EMA replaces it. Everysample_intervalsteps (200 in cell 20) it saves a grid of the batch above its reconstructions, computed in evaluation mode. - Cells 13 and 22:
infer_vqvaereconstructs two batches of 64 CIFAR-10 test images in evaluation mode and saves the 128 reconstructions to a file. - Cells 14–20: CIFAR-10 at normalized to (the comment in cell 15 still says ), batch size 32, Adam at , five epochs.
- Cells 25–27: the priors. Masked convolutions of types A and B, and two PixelCNN priors with seven masked layers of 64 channels and plain ReLUs between them, no gating. The input is an embedding of the code indices,
Embedding(512, 64), and a convolution gives 512 logits per position. The unconditional prior models the top codes. The conditional one models the bottom codes: it embeds the nearest-neighbour upsampled top codes withEmbedding(512, 16), concatenates them with the embedding of the bottom codes and mixes the two with a convolution. Two issues. This plain stack has the blind spot and lacks the gated layers and the attention of the paper’s priors. And because the condition is mixed into the same channels before the first type-A masked layer, the mask also hides the condition at the position being predicted. Each bottom index sees the top codes only through earlier positions, so the top-left index of every block, whose top code appears at no earlier position, is predicted without it. We checked this by differentiating a re-implementation of the network: the logits at a position have zero gradient with respect to the condition at that position. The condition should enter without a mask, added in every layer as in the conditional Gated PixelCNN. - Cells 29–32: datasets that encode every image on the fly into its code grids, and cross-entropy training of the two priors with Adam at learning rate , batch size 32 and 10 epochs each. Encoding should run with the VQ-VAE in evaluation mode, which cell 22 leaves it in; in training mode the quantizer would keep updating its codebook while the codes are being extracted.
- Cells 34–35: sampling: 16 sequential steps for the top grid, 64 for the bottom grid given the upsampled top, and decoding. Each step reruns the PixelCNN on the whole grid.
- Implementation note.
utils.save_image(..., range=(-1, 1))in cells 12, 22 and 35 uses the argument name that torchvision renamed tovalue_range; with current versions these calls need the new name.
The β-VAE has no trained example in the course notebooks: the VAE notebook defines the β-weighted loss in cell 24 but trains only with .
VAPNEV has no implementation in the course repository. The exercise notebook 03_hw_vapnev.ipynb of the same repository states the tasks on CelebA and leaves the code cells empty. Its only saved outputs are the device (mps), the shape of one image, , and a grid of 25 random faces.
- Cells 3–9: data. CelebA through the course’s dataset class, with
Resize(64)andCenterCrop(64), which keep the aspect ratio, and pixels mapped from to by . - Cells 10–11: a normalizing flow on these faces, evaluated with FID and the negative log-likelihood. Any layers are allowed, coupling, autoregressive or linear, either convolutional or on the flattened image; the layers are described in flow architectures. A likelihood quoted for images must account for the dequantization and for the Jacobian of the preprocessing, as Agrawal and Dukkipati do for their logit transform.
- Cells 12–13: a VAE on the same faces, evaluated with FID, as in the VAE notebook.
- Cells 14–15: VAPNEV, following the paper, and a conditional VAPNEV. The notebook leaves the details of the condition to the task description; the natural choice is the 40 CelebA attributes, which the course’s dataset class returns with every image and the wrapper of cell 6 discards.
- Cells 16–17: an analysis of the latent spaces: which model interpolates better, encoding a face from outside CelebA and finding the nearest codes of training images, and the most interesting sample.
Next#
The VAE family trains its generator through a likelihood bound, with or without a discrete code, and pays for the bound with blur, with a separate prior or with a costly flow decoder. The next note takes the opposite route: a generator trained without any likelihood, judged only by a second network that tries to tell its samples from real data.
References#
- I. Higgins, L. Matthey, A. Pal, C. Burgess, X. Glorot, M. Botvinick, S. Mohamed, A. Lerchner. β-VAE: Learning basic visual concepts with a constrained variational framework. ICLR, 2017. Section 1: the definition of disentanglement; Figure 1: CelebA latent traversals.
- A. Alemi, B. Poole, I. Fischer, J. Dillon, R. A. Saurous, K. Murphy. Fixing a Broken ELBO. ICML, 2018. Rate and distortion.
- C. P. Burgess, I. Higgins, A. Pal, L. Matthey, N. Watters, G. Desjardins, A. Lerchner. Understanding disentangling in β-VAE. arXiv, 2018.
- F. Locatello, S. Bauer, M. Lucic, G. Rätsch, S. Gelly, B. Schölkopf, O. Bachem. Challenging Common Assumptions in the Unsupervised Learning of Disentangled Representations. ICML, 2019.
- A. van den Oord, O. Vinyals, K. Kavukcuoglu. Neural Discrete Representation Learning. NeurIPS, 2017. VQ-VAE; the EMA codebook update is in Appendix A.1.
- A. Razavi, A. van den Oord, O. Vinyals. Generating Diverse High-Fidelity Images with VQ-VAE-2. NeurIPS, 2019.
- Y. Bengio, N. Léonard, A. Courville. Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation. arXiv, 2013. The straight-through estimator.
- P. Dhariwal, H. Jun, C. Payne, J. W. Kim, A. Radford, I. Sutskever. Jukebox: A Generative Model for Music. arXiv, 2020. Random restarts of unused codes.
- J. Yu, X. Li, J. Y. Koh, H. Zhang, R. Pang, J. Qin, A. Ku, Y. Xu, J. Baldridge, Y. Wu. Vector-quantized Image Modeling with Improved VQGAN. ICLR, 2022. Factorized, normalized codebook lookup.
- S. Agrawal, A. Dukkipati. Deep Variational Inference Without Pixel-Wise Reconstruction. arXiv:1611.05209, 2016. VAPNEV; Section 3: the conditional likelihood and the conditional coupling layer; Section 4: preprocessing, architecture and results.
- L. Dinh, J. Sohl-Dickstein, S. Bengio. Density Estimation Using Real NVP. ICLR, 2017.
- S. R. Bowman, L. Vilnis, O. Vinyals, A. M. Dai, R. Jozefowicz, S. Bengio. Generating Sentences from a Continuous Space. CoNLL, 2016. Section 3.1: KL cost annealing.