Skip to content

Commit 248aba4

Browse files
committed
Speed up TestARM5_4
1 parent 839827a commit 248aba4

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pymc3/tests/test_examples.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import theano.tensor as tt
77
import pytest
88
import theano
9+
from pymc3.theanof import floatX
910

1011
from .helpers import SeededTest
1112

@@ -43,20 +44,14 @@ def build_model(self):
4344

4445
with pm.Model() as model:
4546
effects = pm.Normal('effects', mu=0, tau=100. ** -2, shape=len(P.columns))
46-
p = tt.nnet.sigmoid(tt.dot(np.array(P), effects))
47-
pm.Bernoulli('s', p, observed=np.array(data.switch))
47+
p = tt.nnet.sigmoid(tt.dot(floatX(np.array(P)), effects))
48+
pm.Bernoulli('s', p, observed=floatX(np.array(data.switch)))
4849
return model
4950

5051
def test_run(self):
5152
model = self.build_model()
5253
with model:
53-
# move the chain to the MAP which should be a good starting point
54-
start = pm.find_MAP()
55-
H = model.fastd2logp() # find a good orientation using the hessian at the MAP
56-
h = H(start)
57-
58-
step = pm.HamiltonianMC(model.vars, h)
59-
pm.sample(50, step=step, start=start)
54+
pm.sample(50, tune=50, n_init=1000)
6055

6156

6257
class TestARM12_6(SeededTest):

0 commit comments

Comments
 (0)