would usually be better off using a generative adversarial network rather than a variational autoencoder you can kind of see this in the cost function the generative adversity all Network is designed to fool the discriminator into thinking that it's samples are realistic and the variational autoencoder is designed to maximize the likelihood I how to sample from the data is just uniform distribution or that's also a really good question and I think one that is a topic of ongoing research the naive way of implementing the algorithm and the