timbmg / VAE-CVAE-MNIST

Variational Autoencoder and Conditional Variational Autoencoder on MNIST in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

normal distribution sampling error

zaocan666 opened this issue · comments

I am afraid there exists a bug in line 42 of models.py
eps = torch.randn_like(std)
torch.randn_like sample from uniform distribution, should have been normal distribution

According to the docs torch.randn_like samples from normal distribution.

Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1

Sorry to bother, it was my fault. I mistook randn_like with rand_like.