Skip to content

Fix `optimize_kl` `plot_minisanity_history` for variable likelihood domain

When the domain of the likelihood function we pass to optimize_kl changes between MGVI iterations (example: we add an additional likelihood term with nuisance parameters) and plot_minisanity_history is enabled, a calculation in _plot_minisanity_history fails.

This happens because the minisanity values to be plotted in this case constitute a ragged array, which the np.max and np.min functions reject.

Please observe the two CI pipelines launched for this branch:

  • The first commit just contains a unit test triggering this bug.
  • The second commit contains a fix.

Merge request reports