Skip to content
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

replace prepare_for_sbi in tutorials #1013

Merged
merged 2 commits into from
Mar 19, 2024
Merged

replace prepare_for_sbi in tutorials #1013

merged 2 commits into from
Mar 19, 2024

Conversation

zinaStef
Copy link
Contributor

@zinaStef zinaStef commented Mar 18, 2024

It replaces in the relevant tutorial notebooks the simulator, prior = prepare_for_sbi(custom_simulator, custom_prior) by

prior, num_parameters, prior_returns_numpy = process_prior(custom_prior)

simulator = process_simulator(simulator, prior, prior_returns_numpy)

Fixes #752

Checklist:

  • I have read and understood the contribution
    guidelines
  • I agree with re-licensing my contribution from AGPLv3 to Apache-2.0.
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have reported how long the new tests run and potentially marked them
    with pytest.mark.slow.
  • New and existing unit tests pass locally with my changes
  • I performed linting and formatting as described in the contribution
    guidelines
  • I rebased on main (or there are no conflicts with main)

@zinaStef zinaStef requested a review from augustes March 18, 2024 17:07
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.37%. Comparing base (7c81e9e) to head (1e51770).
Report is 2 commits behind head on main.

❗ Current head 1e51770 differs from pull request most recent head d20b129. Consider uploading reports for the commit d20b129 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1013   +/-   ##
=======================================
  Coverage   76.37%   76.37%           
=======================================
  Files          84       84           
  Lines        6507     6507           
=======================================
  Hits         4970     4970           
  Misses       1537     1537           
Flag Coverage Δ
unittests 76.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an issue has to be raised for this notebook as it throws an error but not related to replace prepare_for_sbi

Copy link
Contributor

@augustes augustes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate issue has to be raised for notebook 14_iid as it throws an error but not related to replace prepare_for_sbi

@janfb
Copy link
Contributor

janfb commented Mar 19, 2024

There is a conflict with main now because of #1003 being merged. Please resolve it locally by

  • checkout locally on main and pull the most recent version
  • checkout on your feature branch
  • rebase on main: git rebase main
  • resolve the appearing merge conflicts manually.

Alternatively, as resolving conflicts in notebooks can be painful, you could open a new branch from most recent main and apply your changes from scratch.

Let me know if you have questions.

@zinaStef zinaStef merged commit 4c2f71e into main Mar 19, 2024
3 checks passed
@zinaStef zinaStef deleted the prepare_for_sbi_split branch March 19, 2024 09:14
Baschdl pushed a commit to Baschdl/sbi that referenced this pull request Mar 19, 2024
anastasiakrouglova pushed a commit to bkmi/sbi that referenced this pull request Mar 20, 2024
anastasiakrouglova added a commit that referenced this pull request Mar 27, 2024
* 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 <matthijs@example.com>

* 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 <sebastian@salzreute.de>

* Update sbi/neural_nets/flow.py

Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* Update sbi/neural_nets/flow.py

Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* removed pyright

---------

Co-authored-by: bkmi <12955549+bkmi@users.noreply.github.com>
Co-authored-by: Nastya Krouglova <nastyakrouglova@Nastyas-MacBook-Pro.local>
Co-authored-by: Jan Boelts <jan.boelts@mailbox.org>
Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
Co-authored-by: Matthijs Pals <34062419+Matthijspals@users.noreply.github.com>
Co-authored-by: Matthijs <matthijs@example.com>
Co-authored-by: zinaStef <49067201+zinaStef@users.noreply.github.com>
Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>
janfb added a commit that referenced this pull request Apr 5, 2024
* 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 <matthijs@example.com>

* 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 <sebastian@salzreute.de>

* Update sbi/neural_nets/flow.py

Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* Update sbi/neural_nets/flow.py

Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* removed pyright

---------

Co-authored-by: bkmi <12955549+bkmi@users.noreply.github.com>
Co-authored-by: Nastya Krouglova <nastyakrouglova@Nastyas-MacBook-Pro.local>
Co-authored-by: Jan Boelts <jan.boelts@mailbox.org>
Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
Co-authored-by: Matthijs Pals <34062419+Matthijspals@users.noreply.github.com>
Co-authored-by: Matthijs <matthijs@example.com>
Co-authored-by: zinaStef <49067201+zinaStef@users.noreply.github.com>
Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>
janfb added a commit that referenced this pull request Apr 5, 2024
* Zuko density estimators (#1088)

* 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 <matthijs@example.com>

* 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 <sebastian@salzreute.de>

* Update sbi/neural_nets/flow.py

Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* Update sbi/neural_nets/flow.py

Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* removed pyright

---------

Co-authored-by: bkmi <12955549+bkmi@users.noreply.github.com>
Co-authored-by: Nastya Krouglova <nastyakrouglova@Nastyas-MacBook-Pro.local>
Co-authored-by: Jan Boelts <jan.boelts@mailbox.org>
Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
Co-authored-by: Matthijs Pals <34062419+Matthijspals@users.noreply.github.com>
Co-authored-by: Matthijs <matthijs@example.com>
Co-authored-by: zinaStef <49067201+zinaStef@users.noreply.github.com>
Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>

* merge

* hate

* merge

* merge

* merge

* merge

* MERGE

* remove cnf

* implement changes Jan

* Update sbi/neural_nets/factory.py

Co-authored-by: Jan <janfb@users.noreply.github.com>

* resolve issues Jan

* undo changes to tutorials folder.

* sort dependencies.

---------

Co-authored-by: bkmi <12955549+bkmi@users.noreply.github.com>
Co-authored-by: Nastya Krouglova <nastyakrouglova@Nastyas-MacBook-Pro.local>
Co-authored-by: Jan Boelts <jan.boelts@mailbox.org>
Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
Co-authored-by: Matthijs Pals <34062419+Matthijspals@users.noreply.github.com>
Co-authored-by: Matthijs <matthijs@example.com>
Co-authored-by: zinaStef <49067201+zinaStef@users.noreply.github.com>
Co-authored-by: Sebastian Bischoff <sebastian@salzreute.de>
Co-authored-by: Jan <janfb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace prepare_for_sbi with separate calls to for prior and simulator in all tutorials
3 participants