class_docstr: Callback for saving intermediate model checkpoints.
docstr: Save the model on epoch end if the model has improved.
  
  Args:
      epoch: The current epoch.
      logs: The training metrics.
docstr_tok: ["Save","the","model","on","epoch","end","if","the","model","has","improved",".","Args",":","epoch",":","The","current","epoch",".","logs",":","The","training","metrics","."]
code: def on_epoch_end(
      self, epoch: int, logs: Optional[Dict[Text, Any]] = None
  ) -> None:
      """Save the model on epoch end if the model has improved.
  
      Args:
          epoch: The current epoch.
          logs: The training metrics.
      """
      if self._does_model_improve(logs):
          logger.debug(
              f"Creating model checkpoint at epoch={epoch + 1} ..."
          )
          self.model.save_weights(
              self.checkpoint_file, overwrite=True, save_format="tf"
          )
  
file_path: rasa/rasa/utils/tensorflow/callback.py
imports: from pathlib import Path
  from typing import Dict, Text, Any, Optional
  import logging
  import tensorflow
  from tqdm import tqdm
  import rasa.shared.utils.io
label_desc: Use image node_id 2 for calling the RasaModelCheckpoint obj's underlying member method code with example usage: obj.on_epoch_end(epoch, logs) without return types