Skip to content

Commit 3d47b94

Browse files
committed
split hmc testing
1 parent c59492b commit 3d47b94

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/logistic.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def invlogit(x):
99
return np.exp(x)/(1 + np.exp(x))
1010

11-
npred = 4
11+
npred = 20
1212
n = 4000
1313

1414
effects_a = np.random.normal(size = npred)
@@ -39,10 +39,11 @@ def tinvlogit(x):
3939
chain = find_MAP(model, chain)
4040
hmc_cov = approx_cov(model, chain) #find a good orientation using the hessian at the MAP
4141

42-
step_method = metropolis_step(model, model.vars, hmc_cov)
43-
42+
step_method = hmc_step(model, model.vars, hmc_cov)
43+
#step_method = split_hmc_step(model, model.vars, hmc_cov, chain, hmc_cov)
4444

4545
ndraw = 3e3
4646

4747
history = NpHistory(model.vars, ndraw)
48-
print "took :", sample(ndraw, step_method, chain, history)
48+
state, t = sample(ndraw, step_method, chain, history)
49+
print "took :", t

0 commit comments

Comments
 (0)