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

log_abs_det_jacobian will be recalculated when necessary #2384

Merged
merged 2 commits into from
Mar 26, 2020

Conversation

stefanwebb
Copy link
Contributor

This PR fixes a potential pitfall for bugs! Several of the transforms rely on cached values to calculate the log(abs(det(Jacobian))). However, you can call the log_abs_det_jacobian method with any inputs x,y you'd like, and if they don't match the values for the cached Jacobian then the wrong Jacobian is returned.

My solution is to compare x,y to the values that were used to calculate the Jacobian. If they don't match then the Jacobian is recached

Copy link
Member

@fritzo fritzo left a comment

Choose a reason for hiding this comment

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

Nicely done!

@fritzo fritzo merged commit e4cc9f8 into pyro-ppl:dev Mar 26, 2020
@stefanwebb stefanwebb deleted the fix_log_det_J_caching branch May 23, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants