VAE for non MNIST sample

Dear experts,
I am trying to change the VAE example to a non MNIST dataset.
So I am trying to make the VAE learn a set a guassians with different means.
I changed the model as

        z = pyro.sample("latent", dist.Normal(mu, sigma).independent(1))
        output = self.decoder(z)
        pyro.sample("data", dist.Normal(output, 0.1*torch.ones_like(output)), obs=x)

however the loss is NAN from the first iteration.
Probably there is something basic I am missing.

thanks in advance!

Hello,

did you scale your dataset values between 0 and 1 beforehand ? (the decoder has a sigmoid output)

I’m not sure on the validity of the last line of code you provided. If I’m not mistaken you provide a matrice filled with ones for the 2nd parameter of your Normal distribution, instead of a valid cov matrice (which could be obtained through torch.eye for independents var ?)

Cheers,