How does VAE generate the value of mean and sd for the latent space? I am just trying to understand the detailed mechanisms of VAE (variational autoencoder), and even new to Deep Learning.
I was wondering, how does the encoder part of the VAE can make sure to generate the value of Gaussian mean and sd?
I checked the code from Keras, it seems they used the same function to generate this two values? Then how do you know which is which?

Thanks for any replies.

layers.Dense is a dense layer. The code uses a different dense layer for each of the mean and the log-standard deviation. We know that it uses a different dense layer for each because  layers.Dense instantiates a new dense layer object, and that class is used twice.
You're right, there's nothing about this network that mandates that one must be the mean (except for the fact of how they're used). The one that you use for the mean is the mean; the one that you use for the standard deviation is the standard deviation. The advantage to working with log-standard deviation in this model is that you don't have to worry about the non-negativity constraint on the standard deviation because logs of positive numbers are real.
