AdvancedHMC.jl icon indicating copy to clipboard operation
AdvancedHMC.jl copied to clipboard

Progress message `ratio_divergent_transitions_during_adaption` bug

Open sefffal opened this issue 6 months ago • 3 comments

This is difficult to demonstrate, but I believe the value of ratio_divergent_transitions_during_adaption printed during sampling when progress=true is currently incorrect.

The behaviour I've seen is:

  1. During adaptation, numerical errors are encountered causing ratio_divergent_transitions_during_adaption to increase
  2. By the end of adaptation, the numerical errors stop
  3. Sampling continues after adaptation and ratio_divergent_transitions stays zero.
  4. ratio_divergent_transitions_during_adaption starts to drop (even though adaptation is now finished!) until it reaches a lower value, eg 50% lower if there are equal numbers of samples during and after adaptation.

I couldn't find the right location in the code, but I believe that ratio_divergent_transitions_during_adaption might be calculating the ratio using the total number of samples so far, and not stopping updating after adaptation completes.

sefffal avatar Jul 28 '24 15:07 sefffal