What is the mechanism that makes possible for VAEs to create meaningful concept vectors rather than purely random ones? I don't know how to put it better, but if we have n-dimensional data and we want to compress it to m-dimensional space where m<<n what mechanism makes those m content vectors always so meaningful ('smile vector', 'glasses vector' etc.)?
 A: Latent space is meaningful because it learns the more informative features of the data. However the attribute vectors (smile, glasses, etc.) have to be discovered by the user. So, if you want to generate samples based on attributes, you need to inform your model. There are two ways of doing this that I'm aware of.

*

*You have to discover the concept vector taking samples of the images that contain the attribute (positives) and of images that doesn't (negatives). Then you have to obtain their Z vectors, and obtain their respective averages. Finally you have to subtract the negative average vector from the positive and you will have the direction of the attribute of interest, that is your concept vector.  You can check this method in this workbook:

https://github.com/tozanni/Hands-On-Image-Generation-with-TensorFlow-2.0/blob/master/Chapter02/ch2_vae_faces.ipynb


*The other way is by training a Conditional VAE model (CVAE). In this way you can explicitly train the VAE using your labels and generate data based on them. The model will know how to provide you with samples of the data that contain the attribute (you still need to calculate the attribute vector if you want to modulate the intensity). Please have a look at this resources where you can practice with this method:

https://theaiacademy.blogspot.com/2020/05/understanding-conditional-variational.html
https://towardsdatascience.com/variational-autoencoders-vaes-for-dummies-step-by-step-tutorial-69e6d1c9d8e9
