sbi-dev / sbi

Simulation-based inference toolkit
https://sbi-dev.github.io/sbi/
Apache License 2.0
546 stars 133 forks source link

importance sampling posterior #1183

Closed manuelgloeckler closed 2 weeks ago

manuelgloeckler commented 2 weeks ago

What does this implement/fix? Explain your changes

Adds the possibility of importance sampling.

Does this close any currently open issues?

Fixes #919

Any other comments?

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.30%. Comparing base (07e3995) to head (172d010).

:exclamation: There is a different number of reports uploaded between BASE (07e3995) and HEAD (172d010). Click for more details.

HEAD has 1 upload more than BASE | Flag | BASE (07e3995) | HEAD (172d010) | |------|------|------| |unittests|1|2|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1183 +/- ## ========================================== - Coverage 81.76% 73.30% -8.47% ========================================== Files 93 93 Lines 7448 7458 +10 ========================================== - Hits 6090 5467 -623 - Misses 1358 1991 +633 ``` | [Flag](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | `73.30% <100.00%> (-8.47%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | Coverage Δ | | |---|---|---| | [sbi/inference/posteriors/importance\_posterior.py](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183?src=pr&el=tree&filepath=sbi%2Finference%2Fposteriors%2Fimportance_posterior.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#diff-c2JpL2luZmVyZW5jZS9wb3N0ZXJpb3JzL2ltcG9ydGFuY2VfcG9zdGVyaW9yLnB5) | `86.15% <100.00%> (+31.46%)` | :arrow_up: | | [sbi/inference/snle/snle\_base.py](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183?src=pr&el=tree&filepath=sbi%2Finference%2Fsnle%2Fsnle_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#diff-c2JpL2luZmVyZW5jZS9zbmxlL3NubGVfYmFzZS5weQ==) | `93.81% <100.00%> (+0.19%)` | :arrow_up: | | [sbi/inference/snpe/snpe\_base.py](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183?src=pr&el=tree&filepath=sbi%2Finference%2Fsnpe%2Fsnpe_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#diff-c2JpL2luZmVyZW5jZS9zbnBlL3NucGVfYmFzZS5weQ==) | `90.96% <100.00%> (+2.00%)` | :arrow_up: | | [sbi/inference/snre/snre\_base.py](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183?src=pr&el=tree&filepath=sbi%2Finference%2Fsnre%2Fsnre_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#diff-c2JpL2luZmVyZW5jZS9zbnJlL3NucmVfYmFzZS5weQ==) | `94.44% <100.00%> (+0.15%)` | :arrow_up: | ... and [23 files with indirect coverage changes](https://app.codecov.io/gh/sbi-dev/sbi/pull/1183/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev)
manuelgloeckler commented 2 weeks ago

Great, thanks for the pyright fix. Your suggestions resolved it.