Stopper.which_best_in_recent_history()

Stopper.which_best_in_recent_history()#

Stopper.which_best_in_recent_history(i, loss_history)[source]#

Identifies the index of the best observation in the recent loss window.

The recent loss window contains the last p entries of loss_history, looking backwards from the current zero-based iteration i, where p is the patience. This returns the best index in that recent window, not necessarily the global best index in the full loss history.