From 619678a605c6598c5310212b6178838395092c57 Mon Sep 17 00:00:00 2001 From: michaeldeistler Date: Tue, 30 Aug 2022 08:48:51 +0200 Subject: [PATCH] Make slow tests pass for release --- tests/inference_on_device_test.py | 5 ++++- tests/linearGaussian_snle_test.py | 2 +- tests/linearGaussian_snre_test.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/inference_on_device_test.py b/tests/inference_on_device_test.py index 2a02a98be..7538e9923 100644 --- a/tests/inference_on_device_test.py +++ b/tests/inference_on_device_test.py @@ -396,7 +396,10 @@ def test_embedding_nets_integration_training_device( num_transforms=2, ) ) - train_kwargs = dict(force_first_round_loss=True) + if inference_method == SNPE_A: + train_kwargs = dict() + else: + train_kwargs = dict(force_first_round_loss=True) with pytest.raises(Exception) if prior_device != training_device else nullcontext(): inference = inference_method(prior=prior, **nn_kwargs, device=training_device) diff --git a/tests/linearGaussian_snle_test.py b/tests/linearGaussian_snle_test.py index b8507c769..b4f524ede 100644 --- a/tests/linearGaussian_snle_test.py +++ b/tests/linearGaussian_snle_test.py @@ -143,7 +143,7 @@ def test_c2st_and_map_snl_on_linearGaussian_different(num_dim: int, prior_str: s """ num_samples = 500 - num_simulations = 3000 + num_simulations = 4500 trials_to_test = [1] # likelihood_mean will be likelihood_shift+theta diff --git a/tests/linearGaussian_snre_test.py b/tests/linearGaussian_snre_test.py index f07798cd8..66f2d8b9d 100644 --- a/tests/linearGaussian_snre_test.py +++ b/tests/linearGaussian_snre_test.py @@ -160,7 +160,7 @@ def test_c2st_sre_variants_on_linearGaussian( x_o = zeros(num_trials, num_dim) num_samples = 500 - num_simulations = 2600 if num_trials == 1 else 40500 + num_simulations = 3000 if num_trials == 1 else 40500 # `likelihood_mean` will be `likelihood_shift + theta`. likelihood_shift = -1.0 * ones(num_dim)