Variational Autoencoders (VAEs)

Variational Autoencoders are a type of generative model, designed to learn a representation of data and generate new data points similar to the original data.

They are built upon the architecture of traditional autoencoders, consisting of two main parts: the Encoder and the Decoder.

Architecture of Autoencoders

Small note: Despite the decoder being responsible for generating the output, the encoder plays a crucial role in producing a meaningful latent vector. If the latent vector is not well-structured, the decoder will generate meaningless outputs.

Encoder and Decoder

Variational Autoencoder vs. Autoencoder

The primary distinction between an Autoencoder (AE) and a Variational Autoencoder (VAE) lies in how the latent space is structured:

The embeddings of training inputs are learned during training. Without regularizing the space of the embeddings we might end up with a huge space with limited information.

Encode Training

During test time, we might end up with embeddings where we don’t have information in this big space.

Encoder Testing

And.. During the test time in the decoding part, we might end up with meaningless outputs.

Decoder Test

A very high level representation for loss of the VAE:

Loss = Reconstruction Loss + Latent Loss

A very high level representation for loss for the AE:

Loss = Reconstruction Loss

Why Regularization is Necessary

The regularization in VAEs serves several purposes:

This regularization will actually force that the coming embedding from test input will be placed within this constrained space with this way the decoder part hopefully will be able to generate more meaningful outputs.

why vae