Skip to content

Document ABC, simulator_f, add overview table and minor API changes - #93

Merged
dirmeier merged 12 commits into
mainfrom
more-fixes
Sep 28, 2026
Merged

dirmeier merged 12 commits into
mainfrom
more-fixes

Conversation

@dirmeier

@dirmeier dirmeier commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Behaviour and API changes

  • Prior-support rejection. The direct samplers (NPE, FMPE, NPSE, CMPE, AIO) take prior in sample_fn, and sample() forwards it. Draws outside the prior support are rejected, and DirectSampleInfo.acceptance_rate records the acceptance rate. Sequential proposals go through the same path.
  • MCMC n_samples. It now counts the draws returned after warmup. With the NLE/NRE defaults, this returns 2000 draws per chain instead of 1000.
  • NUTS warmup. Adaptation runs n_warmup steps, each chain keeps its own step size and mass matrix, and there is no second warmup.
  • Kernel keyword arguments. make_sampler and the sample_with_* functions forward them: step_size for MALA and RMH, window-adaptation options for NUTS.
  • sbc arguments. They are renamed to n_calibrations and n_samples.
  • Batch norm removed. make_resnet, make_cnf and make_cm no longer take do_batch_norm or batch_norm_decay. The option crashed in a stateless hk.transform.
  • Score models.
    • VE is the default SDE for NPSE and AIO, with separate sigma_min/sigma_max.
    • The VE base distribution is N(0, σ_max²).
    • Dividing the output by the marginal std is opt-in via scale_by_sigma.
  • CMPE. Rewritten to follow Schmitt et al. (2023).
  • Training.
    • Validation uses one key per run.
  • Shape conventions (documented). Every distribution in the prior must be vector-valued, and the simulator must return (n, d), also for d = 1.

Bug fixes

  • MCMC.
    • SBC crashed with NLE/NRE at default arguments.
  • NPSE/AIO
    • log_prob failed for one-dimensional θ.
    • Setting head_size crashed the Simformer.
    • The time embedding was never used by the Simformer encoder.
  • Summary networks
  • ABC
    • SMC-ABC returned weighted particles without weights, started from a random ε, and crashed for a single parameter.
    • SABC reused a stale observation when the array was changed in place.
  • Dead code removed.

Documentation

  • New tutorial docs/notebooks/abc.ipynb covering:
  • An "Implemented methods" table in the README and the docs.
  • A caution box for the shape conventions.

@dirmeier dirmeier changed the title Document ABC, simulator_fn and add overview table Document ABC, simulator_f, add overview table and minor API changes Sep 28, 2026
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.09610% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.79%. Comparing base (6204646) to head (739fa10).

Files with missing lines Patch % Lines
sbijax/_src/experimental/nn/make_score_network.py 52.94% 8 Missing ⚠️
sbijax/_src/inference/summary/_compose.py 60.00% 2 Missing ⚠️
sbijax/_src/nn/make_flow.py 50.00% 2 Missing ⚠️
sbijax/_src/experimental/cmpe.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   91.51%   92.79%   +1.28%     
==========================================
  Files         100      102       +2     
  Lines        3018     3111      +93     
==========================================
+ Hits         2762     2887     +125     
+ Misses        256      224      -32     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dirmeier
dirmeier merged commit 27d5493 into main Sep 28, 2026
13 checks passed
@dirmeier
dirmeier deleted the more-fixes branch September 28, 2026 20:17
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.

1 participant