Skip to content

Commit

Permalink
Only update NUTS divergence stats after tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegrabowski committed Jan 9, 2025
1 parent d336ad8 commit 956ab12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pymc/step_methods/hmc/nuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ def update_stats(stats, step_stats, chain_idx):
if isinstance(step_stats, list):
step_stats = step_stats[0]

stats["divergences"][chain_idx] += step_stats["diverging"]
if not step_stats["tune"]:
stats["divergences"][chain_idx] += step_stats["diverging"]

stats["step_size"][chain_idx] = step_stats["step_size"]
stats["tree_size"][chain_idx] = step_stats["tree_size"]
return stats
Expand Down

0 comments on commit 956ab12

Please sign in to comment.