MCMC for VAE example


I have read the tutorial about VAE and have a question about using MCMC on model of VAE in the tutorial. I don’t know if MCMC could work because as I know, MCMC sample directly latent random variable, not through any gradient step (like SVI), so the decoder network that is registered in the param_store will not be touched and learned. So I post this to ask there is any solution to this problem.

Thank you very much!

Hi @phamtrongthang, you can set priors for your parameters following this tutorial. Then MCMC will work (though it would be slow I think).

1 Like

Thanks. I will try that

Hi @fehiepsi, is there anyway to feed data to MCMC through mini batch like SVI? I’m reading docs and I feel like we need to feed the whole data into. Running in mcmc is already slow, now with whole data then it would be extremely slow …

@phamtrongthang It will require an implementation of stochastic gradient MCMC. You can also use NumPyro to speedup MCMC or if your data is too large, runs it on GPU.

1 Like