class_docstr: A `TrackerCallback` that reduces learning rate when a metric has stopped improving.
class_docstr_tok: ["A","`","TrackerCallback","`","that","reduces","learning","rate","when","a","metric","has","stopped","improving","."]
docstr: Compare the value monitored to its best score and reduce LR by `factor` if no improvement.
docstr_tok: ["Compare","the","value","monitored","to","its","best","score","and","reduce","LR","by","`","factor","`","if","no","improvement","."]
code: def after_epoch(self):
      "Compare the value monitored to its best score and reduce LR by `factor` if no improvement."
      super().after_epoch()
      if self.new_best:
          self.wait = 0
      else:
          self.wait += 1
          if self.wait >= self.patience:
              old_lr = self.opt.hypers[-1]["lr"]
              for h in self.opt.hypers:
                  h["lr"] = max(h["lr"] / self.factor, self.min_lr)
              self.wait = 0
              if self.opt.hypers[-1]["lr"] < old_lr:
                  print(
                      f'Epoch {self.epoch}: reducing lr to {self.opt.hypers[-1]["lr"]}'
                  )
  
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 ReduceLROnPlateau obj's underlying member method code with example usage: obj.after_epoch() without return types