Skip to content

Fix Optimal Transport for Compiled Contexts #446

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

Merged
merged 3 commits into from
Apr 25, 2025

Conversation

LarsKue
Copy link
Contributor

@LarsKue LarsKue commented Apr 25, 2025

We have to remove the skip on is_symbolic_tensor check because otherwise compiled contexts will always skip this function entirely, since the parts seen during compilation are skipped.

@LarsKue LarsKue added the fix Pull request that fixes a bug label Apr 25, 2025
@LarsKue LarsKue self-assigned this Apr 25, 2025
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
bayesflow/utils/optimal_transport/log_sinkhorn.py 100.00% <100.00%> (ø)
bayesflow/utils/optimal_transport/sinkhorn.py 100.00% <100.00%> (+2.17%) ⬆️

... and 5 files with indirect coverage changes

@LarsKue LarsKue marked this pull request as ready for review April 25, 2025 22:58
@LarsKue LarsKue merged commit 16491be into dev Apr 25, 2025
8 checks passed
@LarsKue LarsKue deleted the fix-optimal-transport-for-compiled-contexts branch April 25, 2025 22:58
stefanradev93 added a commit that referenced this pull request Apr 26, 2025
* [no ci] notebook tests: increase timeout, fix platform/backend dependent code

Torch is very slow, so I had to increase the timeout accordingly.

* Enable use of summary networks with functional API again (#434)

* summary networks: add tests for using functional API

* fix build functions for use with functional API

* [no ci] docs: add GitHub and Discourse links, reorder navbar

* [no ci] docs: acknowledge scikit-learn website

* [no ci] docs: capitalize navigation headings

* More tests (#437)

* fix docs of coupling flow

* add additional tests

* Automatically run slow tests when main is involved. (#438)

In addition, this PR limits the slow test to Windows and Python 3.10.
The choices are somewhat arbitrary, my thought was to test the setup not
covered as much through use by the devs.

* Update dispatch

* Update dispatching distributions

* Improve workflow tests with multiple summary nets / approximators

* Fix zombie find_distribution import

* Add readme entry [no ci]

* Update README: NumFOCUS affiliation, awesome-abi list (#445)

* fix is_symbolic_tensor

* remove multiple batch sizes, remove multiple python version tests, remove update-workflows branch from workflow style tests, add __init__ and conftest to test_point_approximators (#443)

* implement compile_from_config and get_compile_config (#442)

* implement compile_from_config and get_compile_config

* add optimizer build to compile_from_config

* Fix Optimal Transport for Compiled Contexts (#446)

* remove the is_symbolic_tensor check because this would otherwise skip the whole function for compiled contexts

* skip pyabc test

* fix sinkhorn and log_sinkhorn message formatting for jax by making the warning message worse

* update dispatch tests for more coverage

* Update issue templates (#448)

* Hotfix Version 2.0.1 (#431)

* fix optimal transport config (#429)

* run linter

* [skip-ci] bump version to 2.0.1

* Update issue templates

* Robustify kwargs passing inference networks, add class variables

* fix convergence method to debug for non-log sinkhorn

* Bump optimal transport default to False

* use logging.info for backend selection instead of logging.debug

* fix model comparison approximator

* improve docs and type hints

* improve One-Sample T-Test Notebook:
- use torch as default backend
- reduce range of N so users of jax won't be stuck with a slow notebook
- use BayesFlow built-in MLP instead of keras.Sequential solution
- general code cleanup

* remove backend print

* [skip ci] turn all single-quoted strings into double-quoted strings

* turn all single-quoted strings into double-quoted strings

amend to trigger workflow

---------

Co-authored-by: Valentin Pratz <git@valentinpratz.de>
Co-authored-by: Valentin Pratz <112951103+vpratz@users.noreply.github.com>
Co-authored-by: stefanradev93 <stefan.radev93@gmail.com>
Co-authored-by: Marvin Schmitt <35921281+marvinschmitt@users.noreply.github.com>
stefanradev93 added a commit that referenced this pull request May 3, 2025
* v2.0.2 (#447)

* [no ci] notebook tests: increase timeout, fix platform/backend dependent code

Torch is very slow, so I had to increase the timeout accordingly.

* Enable use of summary networks with functional API again (#434)

* summary networks: add tests for using functional API

* fix build functions for use with functional API

* [no ci] docs: add GitHub and Discourse links, reorder navbar

* [no ci] docs: acknowledge scikit-learn website

* [no ci] docs: capitalize navigation headings

* More tests (#437)

* fix docs of coupling flow

* add additional tests

* Automatically run slow tests when main is involved. (#438)

In addition, this PR limits the slow test to Windows and Python 3.10.
The choices are somewhat arbitrary, my thought was to test the setup not
covered as much through use by the devs.

* Update dispatch

* Update dispatching distributions

* Improve workflow tests with multiple summary nets / approximators

* Fix zombie find_distribution import

* Add readme entry [no ci]

* Update README: NumFOCUS affiliation, awesome-abi list (#445)

* fix is_symbolic_tensor

* remove multiple batch sizes, remove multiple python version tests, remove update-workflows branch from workflow style tests, add __init__ and conftest to test_point_approximators (#443)

* implement compile_from_config and get_compile_config (#442)

* implement compile_from_config and get_compile_config

* add optimizer build to compile_from_config

* Fix Optimal Transport for Compiled Contexts (#446)

* remove the is_symbolic_tensor check because this would otherwise skip the whole function for compiled contexts

* skip pyabc test

* fix sinkhorn and log_sinkhorn message formatting for jax by making the warning message worse

* update dispatch tests for more coverage

* Update issue templates (#448)

* Hotfix Version 2.0.1 (#431)

* fix optimal transport config (#429)

* run linter

* [skip-ci] bump version to 2.0.1

* Update issue templates

* Robustify kwargs passing inference networks, add class variables

* fix convergence method to debug for non-log sinkhorn

* Bump optimal transport default to False

* use logging.info for backend selection instead of logging.debug

* fix model comparison approximator

* improve docs and type hints

* improve One-Sample T-Test Notebook:
- use torch as default backend
- reduce range of N so users of jax won't be stuck with a slow notebook
- use BayesFlow built-in MLP instead of keras.Sequential solution
- general code cleanup

* remove backend print

* [skip ci] turn all single-quoted strings into double-quoted strings

* turn all single-quoted strings into double-quoted strings

amend to trigger workflow

---------

Co-authored-by: Valentin Pratz <git@valentinpratz.de>
Co-authored-by: Valentin Pratz <112951103+vpratz@users.noreply.github.com>
Co-authored-by: stefanradev93 <stefan.radev93@gmail.com>
Co-authored-by: Marvin Schmitt <35921281+marvinschmitt@users.noreply.github.com>

* drafting feature

* Initialize projectors for invariant and equivariant DeepSet layers

* implement requested changes and improve activation

---------

Co-authored-by: Lars <lars@kuehmichel.de>
Co-authored-by: Valentin Pratz <git@valentinpratz.de>
Co-authored-by: Valentin Pratz <112951103+vpratz@users.noreply.github.com>
Co-authored-by: stefanradev93 <stefan.radev93@gmail.com>
Co-authored-by: Marvin Schmitt <35921281+marvinschmitt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull request that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant