Skip to content

Conversation

@gmoss13
Copy link
Contributor

@gmoss13 gmoss13 commented Nov 17, 2025

Fixes #1702

This PR addresses the bug for FMPE posterior sampling when the condition event dim is greater than 1. I also added a test which checks that the samples are the correct shape, similar to posterior_nn_test.py::test_batched_score_sample_with_different_x, so there is some code repetition, but I think our minimal setup looks quite different when we are dealing with matrix variables so I think this is clearer than trying to fit it in the same test function.

@gmoss13 gmoss13 requested a review from janfb November 17, 2025 15:06
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@2c216c2). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1704   +/-   ##
=======================================
  Coverage        ?   84.65%           
=======================================
  Files           ?      137           
  Lines           ?    11489           
  Branches        ?        0           
=======================================
  Hits            ?     9726           
  Misses          ?     1763           
  Partials        ?        0           
Flag Coverage Δ
unittests 84.65% <100.00%> (?)

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

Files with missing lines Coverage Δ
sbi/inference/potentials/vector_field_potential.py 74.56% <100.00%> (ø)
sbi/samplers/ode_solvers/zuko_ode.py 100.00% <100.00%> (ø)

Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

Thanks @gmoss13 ! I added questions for clarification 🙏

rtol: The relative tolerance for the ODE solver.
exact: Whether the exact log-determinant of the Jacobian or an unbiased
stochastic estimate thereof is calculated.
condition_shape: The shape of the condition tensor.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is without batch dim, so pure event shape, right? maybe specify this in the docstring.

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.

FMPE fails to sample with 2D conditions

3 participants