Commit 0a21509
fix(graphical): seed inherently-stochastic test_full_hierachical
test_full_hierachical fits a marginal hierarchical EP model whose Laplace
refinement (n_refine=3) draws samples from the global np.random state via
NormalMessage.sample, so its recovered mu_logt hyperparameter converges to a
good value or a sigma-collapsed one depending on the ambient RNG state left by
whatever ran before it. The test seeded np.random only before data generation,
not before the fit.
When #1351 added test_ep_statistics_fixes.py, its Monte-Carlo KL-direction
tests consumed np.random and shifted the ambient state into a failing region,
turning the Tests workflow red on main (green at #1347 -> red at #1351/#1354).
The fit's math is unchanged; this is a test-determinism fix. Seed np.random
immediately before the fit so the test is reproducible.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DgCFQoGUbVkspbCjRuKnHJ1 parent ffc04d8 commit 0a21509
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
301 | 309 | | |
302 | 310 | | |
303 | 311 | | |
| |||
0 commit comments