class_docstr: A `TrackerCallback` that terminates training when monitored quantity stops improving.
class_docstr_tok: ["A","`","TrackerCallback","`","that","terminates","training","when","monitored","quantity","stops","improving","."]
docstr: Compare the value monitored to its best score and maybe stop training.
docstr_tok: ["Compare","the","value","monitored","to","its","best","score","and","maybe","stop","training","."]
code: def after_epoch(self):
      "Compare the value monitored to its best score and maybe stop training."
      super().after_epoch()
      if self.new_best:
          self.wait = 0
      else:
          self.wait += 1
          if self.wait >= self.patience:
              print(
                  f"No improvement since epoch {self.epoch-self.wait}: early stopping"
              )
              raise CancelFitException()
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from .fp16 import MixedPrecision
label_desc: Use image node_id 3 for calling the EarlyStoppingCallback obj's underlying member method code with example usage: obj.after_epoch() without return types