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

Fixes current density estimator bug #1155

Conversation

manuelgloeckler
Copy link
Contributor

What does this implement/fix? Explain your changes

Fixes #1154

TODO

  • Add tests to catch this. (check for other density estimators

Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.23%. Comparing base (9a8c7c0) to head (df8899a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1155      +/-   ##
==========================================
- Coverage   83.93%   74.23%   -9.71%     
==========================================
  Files          90       90              
  Lines        6930     6931       +1     
==========================================
- Hits         5817     5145     -672     
- Misses       1113     1786     +673     
Flag Coverage Δ
unittests 74.23% <100.00%> (-9.71%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
sbi/neural_nets/density_estimators/nflows_flow.py 63.46% <100.00%> (+0.71%) ⬆️

... and 23 files with indirect coverage changes

Copy link
Contributor

@michaeldeistler michaeldeistler left a comment

Choose a reason for hiding this comment

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

Thanks a ton!

*sample_shape,
condition_batch_dim,
)
+ self.input_shape
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks! Would

(*sample_shape, condition_batch_dim, *self.input_shape)

also work? It's just a bit cleaner IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Jup, fixed.

@manuelgloeckler
Copy link
Contributor Author

Added tests that check if batched log_prob/sample will be the same as unbatched. Will merge after tests passed.

@manuelgloeckler manuelgloeckler merged commit fe55b1c into main May 7, 2024
5 checks passed
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.

Density Estimator batched sample mixes up samples from different posteriors
2 participants