Skip to content

Commit

Permalink
add regression test for issue 3965 (#3979)
Browse files Browse the repository at this point in the history
* add regression test for issue 3965
* pass on the tune argument to fix #3965

closes #3965
  • Loading branch information
michaelosthege authored Jun 24, 2020
1 parent e88c2f9 commit 69b7975
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pymc3/step_methods/hmc/quadpotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def update(self, sample, grad, tune):
self._ngrads2 += 1

if self._n_samples <= 150:
super().update(sample, grad)
super().update(sample, grad, tune)
else:
self._update((self._ngrads1 / self._grads1) ** 2)

Expand Down
6 changes: 6 additions & 0 deletions pymc3/tests/test_quadpotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,9 @@ def test_full_adapt_sampling(seed=289586):
pymc3.sample(
draws=10, tune=1000, random_seed=seed, step=step, cores=1, chains=1
)


def test_issue_3965():
with pymc3.Model():
pymc3.Normal('n')
pymc3.sample(100, tune=300, chains=1, init='advi+adapt_diag_grad')

0 comments on commit 69b7975

Please sign in to comment.