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

inf/nan checks in Model.log_posterior() incompatible with autograd #7

Open
rscalzo opened this issue Aug 8, 2019 · 0 comments
Open

Comments

@rscalzo
Copy link
Owner

rscalzo commented Aug 8, 2019

I'm trying out a new experimental HMC branch now, and it works fine for Models where log_posterior is defined with autograd primitives. The price is that the sanity checks in the Model.log_posterior() superclass method use np.isinf() and np.isnan() which of course don't have gradients.

This was foreseeable, reminding me that proper range checking is important and that not all Models will be differentiable. The present issue is a placeholder to get me to think a bit more carefully about how autograd will interact with the class hierarchy and what constraints use of autograd imposes. A full solution will involve some kind of signposts for how Models and Proposals interact when derivatives are involved.

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

No branches or pull requests

1 participant