What the encoder outputs
The topic Latent variables and the ELBO gave the VAE (Kingma and Welling, 2014) its objective, the ELBO. Its encoder maps each input to a Gaussian, not a point,
and the KL term pulls every such Gaussian toward the prior . In code, the encoder ends with two heads: one for and one for .
The ELBO's reconstruction term is an expectation over , and we estimate it with a sampled code. To train the encoder, we have to differentiate through that sample. This topic shows how.