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

Fix for rejection sampling #561

Merged
merged 1 commit into from
Dec 16, 2021
Merged

Fix for rejection sampling #561

merged 1 commit into from
Dec 16, 2021

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Dec 16, 2021

The transforms to unconstrained space used in MCMC broke the rejection sampler. We did not realize because there were no rejection sampling tests due to a bug. This PR...

  • ...fixes the bug
  • ...adds rejection sampling API tests

mcmc_method=mcmc_method,
show_progress_bars=False,
)
inference = SNPE_C(prior, show_progress_bars=False)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this change is independent from the rest of the PR. The test still followed the API from sbi<0.14.0

@codecov-commenter
Copy link

Codecov Report

Merging #561 (23f5db3) into main (2a10717) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #561      +/-   ##
==========================================
- Coverage   66.95%   66.92%   -0.03%     
==========================================
  Files          56       56              
  Lines        4185     4191       +6     
==========================================
+ Hits         2802     2805       +3     
- Misses       1383     1386       +3     
Flag Coverage Δ
unittests 66.92% <66.66%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
sbi/inference/posteriors/direct_posterior.py 66.42% <66.66%> (-0.24%) ⬇️
...inference/posteriors/likelihood_based_posterior.py 74.39% <66.66%> (-0.61%) ⬇️
sbi/inference/posteriors/ratio_based_posterior.py 80.00% <66.66%> (-0.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a10717...23f5db3. Read the comment docs.

Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

looks good!

@michaeldeistler michaeldeistler merged commit 41e1fd3 into main Dec 16, 2021
@janfb janfb deleted the transform-fixx branch January 17, 2022 16:32
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.

None yet

3 participants