From 6b26d1a89168135bf950bdf56cfd3f511a09689d Mon Sep 17 00:00:00 2001 From: manuelgloeckler Date: Wed, 13 Aug 2025 12:33:52 +0200 Subject: [PATCH 1/4] Fix --- sbi/inference/potentials/score_fn_iid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbi/inference/potentials/score_fn_iid.py b/sbi/inference/potentials/score_fn_iid.py index 49dbacb05..90e61cf07 100644 --- a/sbi/inference/potentials/score_fn_iid.py +++ b/sbi/inference/potentials/score_fn_iid.py @@ -727,7 +727,7 @@ def marginal_denoising_posterior_precision_est_fn( std = self.vector_field_estimator.std_fn(time) cov0 = std**2 * jac + torch.eye(d)[None, None, :, :] - denoising_posterior_precision = m**2 / std**2 + torch.inverse(cov0) + denoising_posterior_precision = m**2 / std**2 * torch.inverse(cov0) return denoising_posterior_precision From 6bef8494d87dd61f8860e33f9370d2cd09ff8573 Mon Sep 17 00:00:00 2001 From: manuelgloeckler Date: Wed, 13 Aug 2025 14:14:27 +0200 Subject: [PATCH 2/4] Do not fully skip all iid_test but only what is currently adressed in other PRs and what is expected to fail --- tests/linearGaussian_vector_field_test.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/linearGaussian_vector_field_test.py b/tests/linearGaussian_vector_field_test.py index 8bab95ae0..96c035213 100644 --- a/tests/linearGaussian_vector_field_test.py +++ b/tests/linearGaussian_vector_field_test.py @@ -357,18 +357,21 @@ def test_vector_field_sde_ode_sampling_equivalence(vector_field_trained_model): # TODO: Currently, c2st is too high for FMPE (e.g., > 3 number of observations), # so some tests are skipped so far. This seems to be an issue with the # neural network architecture and can be addressed in PR #1501 -@pytest.mark.skip( - reason="c2st too high for some cases, has to be fixed in PR #1501 or #1544" -) @pytest.mark.slow @pytest.mark.parametrize( "iid_method, num_trial", [ - pytest.param("fnpe", 3, id="fnpe-2trials"), + pytest.param( + "fnpe", + 3, + id="fnpe-3trials", + marks=pytest.mark.skip(reason="c2st to high, fixed in PR #1501/1544"), + ), pytest.param("gauss", 3, id="gauss-3trials"), pytest.param("auto_gauss", 8, id="auto_gauss-8trials"), pytest.param("auto_gauss", 16, id="auto_gauss-16trials"), pytest.param("jac_gauss", 8, id="jac_gauss-8trials"), + pytest.param("jac_gauss", 16, id="jac_gauss-16trials"), ], ) def test_vector_field_iid_inference( From 3aab4099dacb098930f23383eb9cea317d04eedb Mon Sep 17 00:00:00 2001 From: manuelgloeckler Date: Wed, 13 Aug 2025 14:31:48 +0200 Subject: [PATCH 3/4] Additional skip for FMPE --- tests/linearGaussian_vector_field_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/linearGaussian_vector_field_test.py b/tests/linearGaussian_vector_field_test.py index 96c035213..f0cffece2 100644 --- a/tests/linearGaussian_vector_field_test.py +++ b/tests/linearGaussian_vector_field_test.py @@ -380,6 +380,10 @@ def test_vector_field_iid_inference( """ Test whether NPSE and FMPE infers well a simple example with available ground truth. """ + if vector_field_type == "fmpe": + # TODO: Remove on merge + pytest.skip(reason="c2st to high, fixed in PR #1501/1544") + num_samples = 1000 # Extract data from fixture From a63e3b23a1f052495764081e96708950494b448d Mon Sep 17 00:00:00 2001 From: manuelgloeckler Date: Wed, 13 Aug 2025 16:13:53 +0200 Subject: [PATCH 4/4] xfail --- tests/linearGaussian_vector_field_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/linearGaussian_vector_field_test.py b/tests/linearGaussian_vector_field_test.py index f0cffece2..812d0c3c1 100644 --- a/tests/linearGaussian_vector_field_test.py +++ b/tests/linearGaussian_vector_field_test.py @@ -365,7 +365,7 @@ def test_vector_field_sde_ode_sampling_equivalence(vector_field_trained_model): "fnpe", 3, id="fnpe-3trials", - marks=pytest.mark.skip(reason="c2st to high, fixed in PR #1501/1544"), + marks=pytest.mark.xfail(reason="c2st to high, fixed in PR #1501/1544"), ), pytest.param("gauss", 3, id="gauss-3trials"), pytest.param("auto_gauss", 8, id="auto_gauss-8trials"), @@ -382,7 +382,7 @@ def test_vector_field_iid_inference( """ if vector_field_type == "fmpe": # TODO: Remove on merge - pytest.skip(reason="c2st to high, fixed in PR #1501/1544") + pytest.xfail(reason="c2st to high, fixed in PR #1501/1544") num_samples = 1000