generating images with variational autoencoders encoder original input decoder compressed representation reconstructed input figure an autoencodermapping an input compressed represent ation and then decoding it back as xin practicesuch classical autoencoders don' lead to particularly useful or nicely structured latent spaces they're not much good at compressioneither for these reasonsthey have largely fallen out of fashion vaeshoweveraugment autoencoders with little bit of statistical magic that forces them to learn continuoushighly structured latent spaces they have turned out to be powerful tool for image generation vaeinstead of compressing its input image into fixed code in the latent spaceturns the image into the parameters of statistical distributiona mean and variance essentiallythis means you're assuming the input image has been generated by statistical processand that the randomness of this process should be taken into accounting during encoding and decoding the vae then uses the mean and variance parameters to randomly sample one element of the distributionand decodes that element back to the original input (see figure the stochasticity of this process improves robustness and forces the latent space to encode meaningful representations everywhereevery point sampled in the latent space is decoded to valid output distribution over latent space defined by z_mean and z_log_var input image encoder reconstructed image decoder point randomly sampled from the distribution figure vae maps an image to wo vect orsz_mean and z_log_sigmawhich define probability distribut ion over the latent spaceused to sample lat ent point to decode licensed to