Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an info warning for HMC with enumeration #1180

Closed
fehiepsi opened this issue Oct 8, 2021 · 4 comments
Closed

Add an info warning for HMC with enumeration #1180

fehiepsi opened this issue Oct 8, 2021 · 4 comments

Comments

@fehiepsi
Copy link
Member

fehiepsi commented Oct 8, 2021

Quoted by @clgarciga in #1174

Also wondering if maybe there is an error or warning that could be thrown when users attempt to use Discrete latents in an HMC/NUTS model?

@cgarciga
Copy link

@fehiepsi in #1174 :

We got many questions with the "automatic" mechanism of enumeration in NUTS. We should inform users that enumerate is using and point users to the enumerate tutorial or a different algorithm like DiscreteHMCGibbs. Do you want to take a stab at this? I believe you can raise the warning at this line.

Sorry it took me a bit to get to this, working on it now though. May I ask, what is the enumerate tutorial you are referring to above?

@fehiepsi
Copy link
Member Author

Hi @clgarciga, you can use this link https://pyro.ai/examples/enumeration.html.

@cgarciga
Copy link

Okay, so, here's where I'm at with this: some MCMC kernels (e.g. HMC,NUTS) don't support discrete latents, and some do (e.g. DiscreteHMCGibbs, Mixed HMC). So I need to:

  1. Check if the user is using MCMC
  2. If yes, check if there are discrete latents in the model
  3. If yes, check which kernel they are using
  4. Check if that kernel supports discretes or not
  5. If not, throw a warning (error?) that they need use a different kernel that supports discretes.
    Does that make sense at all?

@fehiepsi
Copy link
Member Author

fehiepsi commented Oct 14, 2021

I think you can add an info warning/print after this line, which is agnostic to the kernels. I'm not sure how to check properly for each kernel (maybe add an argument enum=False/True to each kernel to decide the behavior? I guess it is a bit out of the scope of this issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants