class_docstr: Callback for checkpointing summarizer models.
class_docstr_tok: ["Callback","for","checkpointing","summarizer","models","."]
code: def on_epoch_end(self, batch, logs=None) -> None:
      if logs is None:
          logs = {}
      if self.file_path is None:
          return
      score = logs[self.monitor]
      score_is_better = False
      if self.best_score is None:
          score_is_better = True
      else:
          if self.mode == "min" and score < self.best_score:
              score_is_better = True
          if self.mode == "max" and score > self.best_score:
              score_is_better = True
      if score_is_better:
          print(
              "{score_name} improved from {prev} to {current}, "
              "saving summarizer to {path}".format(
                  score_name=self.monitor,
                  prev=self.best_score,
                  current=score,
                  path=self.file_path,
              )
          )
          self.best_score = score
          self.summarizer.save(self.file_path)
      else:
          print(
              "{score_name} did not improve.".format(
                  score_name=self.monitor
              )
          )
  
imports: import tensorflow
  from headliner.model.summarizer import Summarizer
label_desc: Use image node_id 2 for calling the ModelCheckpointCallback obj's underlying member method code with example usage: obj.on_epoch_end(batch, logs) without return types