Skip to content

Commit 88c9434

Browse files
junpenglaoColCarroll
authored andcommitted
Reset iter_count in hmc (#3628)
So that early max tree is correct for each independent chain. Fix #3627
1 parent 632fecf commit 88c9434

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pymc3/sampling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,8 @@ def _iter_sample(draws, step, start=None, trace=None, chain=0, tune=None,
605605
try:
606606
step.tune = bool(tune)
607607
for i in range(draws):
608+
if i == 0 and hasattr(step, 'iter_count'):
609+
step.iter_count = 0
608610
if i == tune:
609611
step = stop_tuning(step)
610612
if step.generates_stats:

0 commit comments

Comments
 (0)