File tree Expand file tree Collapse file tree
test_autofit/graphical/hierarchical Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -298,6 +298,14 @@ def test_full_hierachical(data):
298298 },
299299 )
300300
301+ # This fits a *marginal* hierarchical EP model whose Laplace refinement draws
302+ # stochastic samples from the global np.random state (n_refine=3 via
303+ # NormalMessage.sample). The fit sits near a convergence boundary, so its
304+ # recovered fixed point (good vs sigma-collapse) depends on the ambient RNG
305+ # state left by whatever ran before — an inherently stochastic test. Seed here
306+ # so the fit is reproducible; this is the pragmatic fix (see PyAutoFit #1352).
307+ np .random .seed (0 )
308+
301309 laplace = graph .LaplaceOptimiser ()
302310 ep_opt = graph .EPOptimiser (model , default_optimiser = laplace )
303311 new_approx = ep_opt .run (model_approx , max_steps = 10 )
You can’t perform that action at this time.
0 commit comments