Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion sbi/inference/potentials/score_fn_iid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 11 additions & 4 deletions tests/linearGaussian_vector_field_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.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"),
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(
Expand All @@ -377,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.xfail(reason="c2st to high, fixed in PR #1501/1544")

num_samples = 1000

# Extract data from fixture
Expand Down