class_docstr: Callback for checkpointing summarizer models.
class_docstr_tok: ["Callback","for","checkpointing","summarizer","models","."]
docstr: Initializes the Callback.
  
  Args:
      file_path: Path for saving the model (a directory). If existing, the model will be overwritten.
      summarizer: Summarizer to checkpoint.
      monitor: Name of the score monitor for improvements.
      mode: If set to 'min' a decrease of the monitored score is seen as an improvement, otherwise an increase.
docstr_tok: ["Initializes","the","Callback",".","Args",":","file_path",":","Path","for","saving","the","model","(","a","directory",")",".","If","existing",",","the","model","will","be","overwritten",".","summarizer",":","Summarizer","to","checkpoint",".","monitor",":","Name","of","the","score","monitor","for","improvements",".","mode",":","If","set","to","'min","'","a","decrease","of","the","monitored","score","is","seen","as","an","improvement",",","otherwise","an","increase","."]
code: def __init__(
      self,
      file_path: str,
      summarizer: Summarizer,
      monitor="loss_val",
      mode="min",
  ) -> None:
      """
      Initializes the Callback.
  
      Args:
          file_path: Path for saving the model (a directory). If existing, the model will be overwritten.
          summarizer: Summarizer to checkpoint.
          monitor: Name of the score monitor for improvements.
          mode: If set to 'min' a decrease of the monitored score is seen as an improvement, otherwise an increase.
      """
  
      super().__init__()
      self.file_path = file_path
      self.summarizer = summarizer
      self.monitor = monitor
      self.mode = mode
      self.best_score = None
  
imports: import tensorflow
  from headliner.model.summarizer import Summarizer
label_desc: Use image node_id 1 to create a new ModelCheckpointCallback object from inherited base classes: tf.keras.callbacks with example: obj = ModelCheckpointCallback(file_path, summarizer, monitor, mode)