Skip to content

Commit 4945153

Browse files
Only update NUTS divergence stats after tuning
1 parent 50394e3 commit 4945153

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pymc/step_methods/hmc/nuts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ def update_stats(stats, step_stats, chain_idx):
253253
if isinstance(step_stats, list):
254254
step_stats = step_stats[0]
255255

256-
stats["divergences"][chain_idx] += step_stats["diverging"]
256+
if not step_stats["tune"]:
257+
stats["divergences"][chain_idx] += step_stats["diverging"]
258+
257259
stats["step_size"][chain_idx] = step_stats["step_size"]
258260
stats["tree_size"][chain_idx] = step_stats["tree_size"]
259261
return stats

0 commit comments

Comments
 (0)