-
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
add MAF with RQS as density estimator #819
Conversation
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, this looks great! I think we can also use these for SNLE, see comment below. Also, regarding tests, could you add (SNPE_C, "maf_rqs", "direct")
and (SNLE, "maf_rqs", "slice"),
here?
Regarding black: we use a line length of 88 (default) with the latest black version. The black test is currently failing.
sbi/utils/get_nn_models.py
Outdated
elif model == "maf_rqs": | ||
return build_maf_rqs( | ||
batch_x=batch_theta, batch_y=batch_x, **kwargs | ||
) |
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.
any reason to not add this to likelihood_nn
as well?
Great, thanks for adding this @ImahnShekhzadeh ! We should add |
#820 is merged now. The test is marked as
I tested this on your branch and got the following error:
|
@michaeldeistler I added the MAF with RQS to SNLE, added the test statements and I hope the black test runs through now. @janfb I added Please let me know if anything else should be necessary for a merging. |
Any reason to not use |
@michaeldeistler I had used |
Awesome, thank you! |
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 the update!
The functional test with SNPE is still failing with c2st ~ 0.6. I suggest to increase num_simulations=2100
any ideas why maf_rqs
need more training data than the other flows?
@janfb I just ran the test for three times, it ran through for me in all cases. The c2st for snpe_maf_rqs (with |
Oh, ok. That's probably due to random init and different RNG settings on our machines. So, no, let's keep it at |
One last thing: could you please run black v23.1.0 and isort v5.11.5: locally and then push again? |
@janfb Sure, it's done. |
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.
can be merged once CI tests are passing.
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #819 +/- ##
==========================================
- Coverage 74.83% 74.59% -0.25%
==========================================
Files 80 80
Lines 6196 6222 +26
==========================================
+ Hits 4637 4641 +4
- Misses 1559 1581 +22
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. |
Hi,
for SNPE, these were the options:
mdn
,made
,maf
andnsf
(cf. the functionposterior_nn
insbi/utils/get_nn_models.py
).The MAF uses affine-linear diffeomorphisms (and no RQS), the NSF uses coupling flows with RQS. I added MAFs with RQS (which is the new option
maf_rqs
).About
black
formatting: I'm unsure what the maximum line length is in this project, so I haven't black formatted my code yet.