@@ -38,23 +38,21 @@ def _create_npe(num_simulations, max_epochs=None):
3838 inference = NPE (prior , density_estimator = 'maf' )
3939 inference = inference .append_simulations (theta = theta_train , x = x_train )
4040
41- train_kwargs = {"training_batch_size" : 100 }
42- if max_epochs :
43- train_kwargs ["max_num_epochs" ] = max_epochs
44-
45- return inference .train (** train_kwargs )
41+ return inference .train (
42+ max_num_epochs = 2 ** 31 - 1 if max_epochs is None else max_epochs ,
43+ )
4644
4745 return _create_npe
4846
4947
5048@pytest .fixture (scope = "session" )
5149def badly_trained_npe (npe_factory ):
52- return npe_factory (num_simulations = 100 , max_epochs = 1 )
50+ return npe_factory (num_simulations = 50 , max_epochs = 1 )
5351
5452
5553@pytest .fixture (scope = "session" )
5654def well_trained_npe (npe_factory ):
57- return npe_factory (num_simulations = 10_000 )
55+ return npe_factory (num_simulations = 5_000 )
5856
5957
6058@pytest .fixture (scope = "session" )
@@ -276,7 +274,7 @@ def test_lc2st_false_positiv_rate(method, basic_setup, well_trained_npe, set_see
276274 proportion_rejected = torch .tensor (results ).float ().mean ()
277275
278276 assert proportion_rejected < (1 - confidence_level ), (
279- f "LC2ST p-values too small, test should be rejected \
280- less then { (1 - confidence_level ) * 100 } % of the time, \
281- but was rejected { proportion_rejected * 100 } % of the time."
277+ "LC2ST p-values too small, test should be rejected "
278+ f" less then { (1 - confidence_level ) * 100.0 :<.2f } % of the time, "
279+ f" but was rejected { proportion_rejected * 100.0 :<.2f } % of the time."
282280 )
0 commit comments