Skip to content

Commit

Permalink
fixed issue in callback for first iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed Apr 25, 2024
1 parent 4bf86ec commit 50b56ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/abstractmcmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ function (cb::HMCProgressCallback)(rng, model, spl, t, state, i; nadapts = 0, kw
κ = state.κ
tstat = t.stat
isadapted = tstat.is_adapt
if isadapted
# The initial transition will not much information beyond the `is_adapt` field.
if isadapted && haskey(tstat, :numerical_error)
cb.num_divergent_transitions_during_adaption[] += tstat.numerical_error
else
cb.num_divergent_transitions[] += tstat.numerical_error
Expand Down

0 comments on commit 50b56ab

Please sign in to comment.