class_docstr: A `TrackerCallback` that saves the model's best during training and loads it at the end.
class_docstr_tok: ["A","`","TrackerCallback","`","that","saves","the","model","'s","best","during","training","and","loads","it","at","the","end","."]
docstr: Compare the value monitored to its best score and save if best.
docstr_tok: ["Compare","the","value","monitored","to","its","best","score","and","save","if","best","."]
code: def after_epoch(self):
      "Compare the value monitored to its best score and save if best."
      if self.every_epoch:
          if (self.epoch % self.every_epoch) == 0:
              self._save(f"{self.fname}_{self.epoch}")
      else:  # every improvement
          super().after_epoch()
          if self.new_best:
              print(
                  f"Better model found at epoch {self.epoch} with {self.monitor} value: {self.best}."
              )
              self._save(f"{self.fname}")
  
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 SaveModelCallback obj's underlying member method code with example usage: obj.after_epoch() without return types