-
Notifications
You must be signed in to change notification settings - Fork 155
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
Contrastive Neural Ratio Estimation #787
Conversation
Dear @bkmi |
|
The tests are extremely slow. Any hints here? Is there a way to only run the ratio-relevant ones? I could run only the tests that I changed, but I did slightly alter the |
yes, you can run specific tests like this (in the
or run all tests in that file (exlcuding marked gpu and slow tests):
|
I found a bug in If you like my proposal I will include the fix in this PR. |
We decided to make this a different PR. |
Codecov Report
@@ Coverage Diff @@
## main #787 +/- ##
==========================================
+ Coverage 74.62% 74.80% +0.17%
==========================================
Files 79 80 +1
Lines 6144 6187 +43
==========================================
+ Hits 4585 4628 +43
Misses 1559 1559
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I think this pull request is ready to be reviewed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks again for adding this to SBI!
looks great already, I added some minor comments. One general question I have concerns the sequential version of NRE_C. If it is not exact this should be clearly stated in the docstrings and we should add a warning or even an error when it is used in sequential mode, informing about the practical consequences.
But maybe I am missing something here, I am happy to discuss this in more detail.
EDIT: Slow and gpu tests are passing!
I will comment more carefully soon, but just to be clear... It is not that NRE-C is anymore inaccurate than any other sequential method, rather the guarantee that, at optimum, In NRE-A this optimum holds (only in the first round). In NRE-B, this never holds. NRE-C is just like NRE-A in this regard. NRE-B is the default method but does not carry the warning. We could add the warning to all NRE methods, but I don't think that is a good answer. After all, this does not affect posteriors but rather ways to test them. Sequential methods generally make diagnostics on the posterior more difficult (or impossible). If we added a warning here, it is my opinion that a general statement that sequential methods are not easily testable would be more appropriate and honest. Perhaps the best answer would be for me to be very specific in the comment about what is meant regarding the sequential behavior of NRE-C, namely that an unknown multiplicative term in |
I see, thanks for clarifying! |
Thanks for your patience, NeurIPS delayed me on this. (There are still TODOs) |
Jumping in here regarding warnings for unnormalized posteriors: the way this is currently handled is that the I suggest to describe in the docstring of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot Ben! It looks great overall, I made just a few comments.
I'm going to go with this approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great now, thanks a lot for adding SNRE_C and for the detailed discussion!
We merged the other PR with BNRE already, which might have caused merge conflicts with this branch, sorry!
Once those are resolved, this is good to into main
as well!
…idate the discussion of the effects on .potential to that function / description of nre-c.
I clarified the effects and left it to I also resolved the merge conflicts. Assuming the tests pass I'd say it's good to go~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the conflicts and the pyright problems with the python versions.
Looks great now!
Thanks everyone! Really appreciate the inclusion of NRE-C in |
Thanks a lot for contributing, Ben! And congrats on the work itself! |
Yeah, thanks a lot @bkmi! It was a pleasure, and kudos for your work! |
Dear SBI,
I would like to add our algorithm NRE-C to the SNRE section. I created the following checklist which I will update as the draft nears completion.
Let me know if there's anything else I can do!
Ben