Open mberaha opened 5 years ago
Heya @mberaha,
Currently there's no easy way to accomplish Gibbs sampling of any sort in TFP, you'd effectively need to implement a new TransitionKernel which does the overall transition you're interested in. We are very interested in adding some sort of blocked Gibbs, mostly focusing on Metropolis-Hastings-Within-Gibbs use case. Roughly speaking, we're thinking requiring the user to partition their state and then assign a transition operator for each partition: then we'll be able to take a single joint log probability function and alternate between the multiple transitions that way. Would that be sufficient for your use case? Do you need exact transitions as well (for proper blocked Gibbs sampling)?
Hey @SiegeLordEx, thanks a lot for your reply!
I think your idea is great, and would be very interesting to use. On my side, most of the times I have access to the full conditionals (but mainly bc of laziness), still I think that having a Metropolis-Hastings-Within-Gibbs tutorial would really help me to understand better how tfp works :)
Hi @SiegeLordEx , I'm also very interested in using tfp for Metropolis-Hastings-Within-Gibbs. Is there any tutorial for that? Or are there any good tutorials on developing TransitionKernel that you mentioned earlier? I'm sill very new to tfp, but very excited in learning its functionalities.
For MH within Gibbs, you can see this answer: https://github.com/tensorflow/probability/issues/495 where @SiegeLordEx sketched how you would go about to implement something like that.
@chrism0dwk has proposed an implementation in #1233. It's currently waiting on review.
I usually code my MCMC algorithms (mostly gibbs in BNP) in C++, but this time I thought I might switch to tfp for a change. Is there anyone using tfp for (blocked) gibbs sampling / some resources online?
Thank you