Skip to content

Commit c64ff91

Browse files
committed
fix Metrop test
1 parent eb4c56c commit c64ff91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_step.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ def check_stat(name, trace, var, stat, value, bound):
1010

1111
def test_step_continuous():
1212
start, model, (mu, C) = mv_simple()
13-
H = np.linalg.inv(C)
14-
1513

16-
hmc = pm.HamiltonianMC(model, model.vars, H)
17-
mh = pm.Metropolis(model, model.vars , C, scaling = .25)
14+
hmc = pm.HamiltonianMC(model, model.vars, C, is_cov = True)
15+
mh = pm.Metropolis(model, model.vars , C, is_cov = True, scaling = 2)
1816
compound = pm.CompoundStep([hmc, mh])
1917

2018
steps = [mh, hmc, compound]
@@ -24,6 +22,8 @@ def test_step_continuous():
2422
('x', np.std , unc, unc/10.)]
2523

2624
for st in steps:
25+
np.random.seed(1)
26+
h = sample(model, 8000, st, start)
2727
for (var, stat, val, bound) in check:
2828
np.random.seed(1)
2929
h = sample(model, 8000, st, start)

0 commit comments

Comments
 (0)