I am a student and I am studying machine learning. I am focusing on **deep generative models**, and in particular to **autoencoders** and **variational autoencoders (VAE)**.

I am trying to understand the concept, but I am having some problems.

So far, I have understood that an autoencoder takes an input, for example an image, and wants to reduce this image into a **latent space**, which should contain the **underlying features** of the dataset, with an operation of **encoding**, then, with an operation of **decoding**, it reconstrunct the image which has lost some information due to the encoding part.

After this, with a loss function, it reconstruct the latent space and so get the latent features.

[![enter image description here][1]][1]

about the VAE, it uses a probabilistic approch, so we have to learn the meand anv covariance of a gaussian.

So far this is what I have understood. 

What I have really unclear is **what are we trying to learn with autoencoders and VAE?**

I have seen examples where an image goes feom a non smiling to a smiling face, or to a black and white image to a colored image.

But I don't understand the main concept, which is: **what does an autoencoder do?**

I add here some sources of where I studied so that who needs can see them:

 1. [https://hackernoon.com/autoencoders-deep-learning-bits-1-11731e200694][2]
 2. https://www.youtube.com/watch?v=yFBFl1cLYx8
 3. [https://www.youtube.com/watch?v=9zKuYvjFFS8][3]


  [1]: https://i.sstatic.net/wYQwD.png
  [2]: https://hackernoon.com/autoencoders-deep-learning-bits-1-11731e200694
  [3]: https://www.youtube.com/watch?v=9zKuYvjFFS8