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

transforms in mcmc/api.py #2263

Merged
merged 1 commit into from
Jan 16, 2020
Merged

Conversation

ludkinm
Copy link
Contributor

@ludkinm ludkinm commented Jan 16, 2020

When trying to use a custom MCMC kernel, inherited from MCMCKernel, the MCMC api raises an error at line 398 since self.transforms is None.
This is because the if block starting at line 387 always fails for any self.kernel which is not HMC or NUTS.

I propose removing the check that self.kernel is an instance of HMC or NUTS to allow for custom kernels.

This raises a problem: self.kernel.transforms may not exist for the check on line 388.
I propose changing that to first check that hasattr(self.kernel, 'transforms')

Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and clearly explaining the issue!

@fehiepsi fehiepsi merged commit dcb7d8b into pyro-ppl:dev Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants