PyTorch-VAE icon indicating copy to clipboard operation
PyTorch-VAE copied to clipboard

Sampling Vanilla VAE

Open ethancohen123 opened this issue 3 years ago • 3 comments

Hi, First, thanks for all the shared work ! I have a question concerning the sampling function in the Vanilla VAE. Why do you sample from a normal distribution (0,1) and not from a normal distribution with the learned parameters mu and sigma ? Since when we train the network we decode from the latent space over this distribution isnt more meaningful to sample from this distribution ? Maybe is there something I didnt get. Thank you again

ethancohen123 avatar May 27 '21 14:05 ethancohen123

I am not sure ideally it should be scaled like below i think.

mu/var comes out of the encoder network.

final_samples = mu + (sqrt(var) * samples)

iitrsamrat avatar Jul 17 '21 15:07 iitrsamrat

I have the same question. @AntixK

lihuiliullh avatar Apr 02 '22 01:04 lihuiliullh

When you do sampling, it means you did not have "input" images, you only sample from some distribution, here is a standard normal distribution. In other words, when sampling you did not have encoder, only use decoder, so you did not have this mu and var.

wztdream avatar Nov 03 '22 02:11 wztdream