OptimResult.plot_loss()

OptimResult.plot_loss()#

OptimResult.plot_loss(legend=True, title=None, window=None)[source]#

Plots the epoch-mean training loss and configured monitoring loss.

The training series averages pre-update losses evaluated along each epoch’s optimization trajectory. It is not a full-data loss evaluated at the epoch’s final position. The monitoring label identifies whether the corresponding series is a training EMA, validation loss, or full-data training loss. For exact monitors, the minimum line identifies the saved post-update position used for that value. For an EMA, it identifies only the associated parameter snapshot.

Parameters:
  • legend (bool, default: True) – Whether to show the plot legend.

  • title (str | None, default: None) – Optional plot title.

  • window (int | None, default: None) – Optional number of final epochs to show. If None, all epochs are shown.

Returns:

plotnine.ggplot – Plot object with training and monitoring loss curves. A vertical line marks min_monitor_epoch when it is inside the displayed window.