Categories
Artificial Intelligence (AI) Mastering Development

Why variational autoencoder(VAE) uses reconstruction loss?

VAE is trained to reduce following two losses.

  1. KL divergence between inferred latent distribution and Gaussian.

  2. the reconstruction loss

I understand that first one regularize VAE to get structured latent space.
My question is, why and how does the second loss help VAE to work?

During training of the VAE, we first feed an image to the encoder.
Then, the encoder infer mean and variance.
After that we re-sample z from the inferred distribution.

Finally generator(decoder) gets re-sampled z and generates image.
(And VAE is trained to make the generated image to be equal with original input image.)

Here, I cannot understand why the re-sampled z should makes original image.
Since the z is re-sampled one, it seems that the z does not have any relationship between original image.

But, as you know, VAE works well.. so I think I miss something important or understand it in totally wrong way.
Kind explanation will be greatly appreciated. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *