sbi-dev / sbi

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

Fixes current density estimator bug #1155

Closed manuelgloeckler closed 5 months ago

manuelgloeckler commented 5 months ago

What does this implement/fix? Explain your changes

Fixes #1154

TODO

codecov[bot] commented 5 months ago

Codecov Report

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

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/sbi-dev/sbi/pull/1155/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/1155/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev) | `74.23% <100.00%> (-9.71%)` | :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/1155?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/neural\_nets/density\_estimators/nflows\_flow.py](https://app.codecov.io/gh/sbi-dev/sbi/pull/1155?src=pr&el=tree&filepath=sbi%2Fneural_nets%2Fdensity_estimators%2Fnflows_flow.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sbi-dev#diff-c2JpL25ldXJhbF9uZXRzL2RlbnNpdHlfZXN0aW1hdG9ycy9uZmxvd3NfZmxvdy5weQ==) | `63.46% <100.00%> (+0.71%)` | :arrow_up: | ... and [23 files with indirect coverage changes](https://app.codecov.io/gh/sbi-dev/sbi/pull/1155/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 5 months ago

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