Skip to content
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e503c88
logit transform changes
Mar 17, 2025
f488f86
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Mar 18, 2025
3737ee6
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Mar 18, 2025
8be9079
add new ZScoreTypes
Mar 18, 2025
23bd180
add new ZScoreTypes
Mar 18, 2025
162b976
resolving bug z_scoring last year
Mar 19, 2025
c5772d2
resolving bug z_scoring last year
Mar 19, 2025
b279eb0
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Mar 19, 2025
993efb7
revert z_score parser
Mar 19, 2025
443b8ef
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Mar 19, 2025
862f3d2
adjusted logit structure in build_zuko_flow
Mar 19, 2025
bccd82b
resolve pyright error
Mar 19, 2025
3e3a8d5
Merge branch 'main' into logit_transform
anastasiakrouglova Mar 19, 2025
145ef4e
revert flow as a test
Mar 20, 2025
5a26157
add x_dist variable
Mar 20, 2025
0dd3baa
add logit to sbiutils_test.py
Mar 20, 2025
000c123
add logit if statement
Mar 20, 2025
b3bc54b
add logit if statement
Mar 20, 2025
fa80559
add logit if statement
Mar 20, 2025
1de1a98
add logit if statement
Mar 20, 2025
e2007af
remove logit if statement
Mar 20, 2025
1603756
resolve pyright issues
Mar 20, 2025
1ffd0e9
cover logit in tests
Mar 20, 2025
73af5ac
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Mar 20, 2025
9cc887b
cover tests for logit in flow.py
Mar 20, 2025
9573905
cover tests for CNF
Mar 20, 2025
adff499
adding faq for logit transformation
Mar 20, 2025
8176707
adding faq for logit transformation
Mar 20, 2025
12c4c85
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Mar 21, 2025
69502d7
stash changes
Mar 21, 2025
d617030
feedback guy adjustments
Mar 21, 2025
9037534
add documentation if statements
Mar 21, 2025
db361a0
update sbiutils
Jun 10, 2025
d660631
resolve comment 1 and 2 of Jan
Jun 10, 2025
9332583
ruff linted push
Jun 10, 2025
7dcf919
cleanup density_estimator_test.py
Jun 10, 2025
bbca1ed
cleanup density_estimator_test.py and ruff check
Jun 10, 2025
7142ccb
Merge branch 'sbi-dev:main' into logit_transform
anastasiakrouglova Jul 1, 2025
b09ebb7
adjusted docstrings
Jul 1, 2025
8c029f4
add tests convergence unconstrained space
Jul 2, 2025
d63af48
adjust faq
Jul 2, 2025
9fb371a
add test snle
Jul 2, 2025
be06d58
adjust linear gaussian and estimate c2st
Jul 2, 2025
c732ded
adjust documentation
Jul 28, 2025
021d67f
Update sbi/neural_nets/net_builders/flow.py
anastasiakrouglova Jul 28, 2025
d375df9
Update sbi/utils/sbiutils.py
anastasiakrouglova Jul 28, 2025
bd0c055
Update sbi/utils/sbiutils.py
anastasiakrouglova Jul 28, 2025
3908896
add literal import to sbi utils
Jul 29, 2025
33129d8
adjust literals and add get_transform_to_unconstrained
Jul 29, 2025
580fd50
adjust literals and format
Jul 29, 2025
dfd9948
add new line for ruff
Jul 29, 2025
d6dca31
stying ruff
Jul 29, 2025
b8cd4da
stying ruff
Jul 29, 2025
e528737
fix flow builder z-score defaults.
janfb Jul 31, 2025
0665400
refactor zuko flow build functions
janfb Jul 31, 2025
4d4bfb8
re-use y-embedding helper function.
janfb Jul 31, 2025
8946a09
fix typing
janfb Jul 31, 2025
89f990c
Merge branch 'main' into logit_transform
janfb Jul 31, 2025
340ba70
small fixes.
janfb Jul 31, 2025
c4aa2d1
fix unconstrained nle test
janfb Jul 31, 2025
1ee797d
refactor z-score-parser test
janfb Jul 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/faq/question_08_unconstrained.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Using the logit transformation
If you've ruled out simulator issues, you can try
training your density or ratio estimator in an unbounded space
using a logit transformation:

- **For NPE**: The transformation maps bounded parameters θ
to unbounded space before training, then applies the inverse (sigmoid)
after training to ensure posterior samples stay within prior bounds.

- **For NLE/NRE**: The transformation would need to map bounded
data x to unbounded space, which requires estimating data bounds
from simulations (more complex).

To enable this for NPE:

```python
density_estimator_build_fun = posterior_nn(
model="zuko_nsf",
hidden_features=60,
num_transforms=3,
z_score_theta="transform_to_unconstrained" # Transforms parameters to unconstrained space
x_dist=prior # For NPE, this specifies bounds for parameters (internally called 'x')
)
inference = NPE(prior, density_estimator=density_estimator_build_fun)
```

This ensures that your density estimator operates in a
transformed space where it respects prior bounds,
improving the efficiency of rejection sampling.

Note: The `x_dist=prior` might seem confusing - internally,
sbi uses generic `x,y` notation where for NPE, `x` represents
parameters (θ) and `y` represents data.
This is why we pass the prior as `x_dist`.

Important:

- This transformation is currently only supported for zuko density estimators.
- For **NLE/NRE**, setting up this transformation is more
complex as it requires estimating bounds for the simulated data
rather than using prior bounds.
Loading