Repository navigation
Zuko density estimators (#1088) - #1116
Conversation
* update zuko to 1.1.0 * test zuko_gmm commit * build_zuko_nsf added * add build_zuko_naf, update test * add license change to pr template. * CLN pyproject.toml (#1009) * CLN pyproject.toml * CLN optional deps comment * CLN alphabetical order * fix x_o and broken link tutorial 7 (#1003) * fix x_o and broken link tutorial 7 * typo in title * suppress plotting output --------- Co-authored-by: Matthijs <[email protected]> * replace prepare_for_sbi in tutorials (#1013) * add zuko density estimators * not working gmm * update tests for PR * update PR for pyright * resolve pyright * add reportArgumentType * resolve pyright issue * resolve all issues pyright * resolve pyright * add typing and docstring * add functions from factory to test * remove comment mdn file * add docstrings flow file * add docstring in density_estimator_test.py * Update sbi/neural_nets/flow.py Co-authored-by: Sebastian Bischoff <[email protected]> * Update sbi/neural_nets/flow.py Co-authored-by: Sebastian Bischoff <[email protected]> * Update sbi/neural_nets/flow.py Co-authored-by: Sebastian Bischoff <[email protected]> * removed pyright --------- Co-authored-by: bkmi <[email protected]> Co-authored-by: Nastya Krouglova <[email protected]> Co-authored-by: Jan Boelts <[email protected]> Co-authored-by: Thomas Moreau <[email protected]> Co-authored-by: Matthijs Pals <[email protected]> Co-authored-by: Matthijs <[email protected]> Co-authored-by: zinaStef <[email protected]> Co-authored-by: Sebastian Bischoff <[email protected]>
|
@anastasiakrouglova Could you resolve the merge conflicts with main? This should also trigger the tests to run. |
janfb
left a comment
There was a problem hiding this comment.
thanks a lot for adding all the flows! 🔥
I added a couple of suggestions, please have a look. Happy to discuss them if needed.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1116 +/- ##
==========================================
- Coverage 85.45% 77.20% -8.25%
==========================================
Files 90 89 -1
Lines 6612 6610 -2
==========================================
- Hits 5650 5103 -547
- Misses 962 1507 +545
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Thank you for the feedback. I finally removed the CNF zuko flow, but all the rest is implemented. |
janfb
left a comment
There was a problem hiding this comment.
Great, thanks!
I added three last comments.
Co-authored-by: Jan <[email protected]>
janfb
left a comment
There was a problem hiding this comment.
One last issue about the changes in the embedding net tutorial notebook.
|
Indeed, it's quite confusing. These changes to the I can try to fix it by explicitly removing those notebook changes from this PR and move them to a separate branch as a backup. |
|
Okay that would be awesome, thank you! I'm not sure where the issues come from. At first, I was accidentally merging with the main of the forked bkmi/sbi repository. So maybe it came from this place? |
janfb
left a comment
There was a problem hiding this comment.
Alright, now we are good!
(The notebook changes were duplicates or an older version of that notebook that was merged in on the way, so it was fine to discard them.)
Thanks so much again for adding all the zuko flows - great work! 👏
|
Great!! Thank you so much for reviewing it thoroughly! |
CNF was dropped from the model registry when the Zuko flows were added in sbi-dev#1116, but its builder stayed. `posterior_nn("zuko_cnf")` raises `NotImplementedError` when it builds, and nothing in sbi calls the builder. `build_zuko_flow("CNF", ...)` builds the same network and stays tested. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o_cnf, merge z-score embedding helpers (#2162) The per-model configs are importable only from sbi.neural_nets. The re-exports from sbi.neural_nets.net_builders never reached a release and are gone. build_zuko_cnf and the "CNF" option of build_zuko_flow are removed. Nothing in sbi reached them since #1116; for a continuous normalizing flow, use flow matching (FMPE). The unused build-context types (ZScoreConfig, ZScoreStats, BuildContext, compute_z_score_stats) move to the private module sbi.neural_nets._build_context until the planned z-score pre-pass uses them. Seven copies of the code that puts a z-scoring layer in front of an embedding net become one helper, build_z_scored_embedding_net in sbi.utils.sbiutils. Every builder builds the same network as before. transform_to_unconstrained now raises a ValueError for the condition of the build_* functions, for classifier inputs and when a RestrictionEstimator with z_score="transform_to_unconstrained" trains; before, it was silently ignored. The type hints offer it only where it works: the modeled variable of the Zuko flows and the MDN.
What does this implement/fix? Explain your changes
Provides Zuko density estimators and resolves comments from previous PR.
Does this close any currently open issues?
Fixes # (issue)
Any relevant code examples, logs, error output, etc?
Up to date with latest comments
Any other comments?
Checklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.
guidelines
with
pytest.mark.slow.guidelines
main(or there are no conflicts withmain)