Skip to content
Merged
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
8 changes: 8 additions & 0 deletions test_autofit/graphical/hierarchical/test_hierarchical.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ def test_full_hierachical(data):
},
)

# This fits a *marginal* hierarchical EP model whose Laplace refinement draws
# stochastic samples from the global np.random state (n_refine=3 via
# NormalMessage.sample). The fit sits near a convergence boundary, so its
# recovered fixed point (good vs sigma-collapse) depends on the ambient RNG
# state left by whatever ran before — an inherently stochastic test. Seed here
# so the fit is reproducible; this is the pragmatic fix (see PyAutoFit #1352).
np.random.seed(0)

laplace = graph.LaplaceOptimiser()
ep_opt = graph.EPOptimiser(model, default_optimiser=laplace)
new_approx = ep_opt.run(model_approx, max_steps=10)
Expand Down
Loading