class_docstr: Callback that save the model at the end of every epoch.
  
  Args:
      filepath: the where to save the mode.
      monitor: the name of the value to track.
  
  **Usage example:**
  
  .. code:: python
  
      model_checkpoint = ModelCheckpoint(
          filepath="./outputs", monitor="top5",
      )
  
      trainer = ImageClassifierTrainer(...,
          callbacks={"on_checkpoint", model_checkpoint}
      )
class_docstr_tok: ["Callback","that","save","the","model","at","the","end","of","every","epoch",".","Args",":","filepath",":","the","where","to","save","the","mode",".","monitor",":","the","name","of","the","value","to","track",".","*","*","Usage","example",":","*","*","..","code",":",":","python","model_checkpoint","=","ModelCheckpoint","(","filepath=","''",".\/outputs","''",",","monitor=","''","top5","''",",",")","trainer","=","ImageClassifierTrainer","(","...",",","callbacks=","{","``","on_checkpoint","''",",","model_checkpoint","}",")"]
code: def __init__(
      self,
      filepath: str,
      monitor: str,
      filename_fcn: Optional[Callable[..., str]] = None,
  ) -> None:
      self.filepath = filepath
      self.monitor = monitor
      self._filename_fcn = filename_fcn or default_filename_fcn
  
      # track best model
      self.best_metric: float = 0.0
  
      # create directory
      Path(self.filepath).mkdir(parents=True, exist_ok=True)
  
file_path: kornia/kornia/x/callbacks.py
imports: from pathlib import Path
  from typing import Callable, Dict, Optional, Union
  import torch
  from kornia.core import Module
  from kornia.metrics import AverageMeter
  from .utils import TrainerState
label_desc: Use image node_id 1 to create a new ModelCheckpoint object  with example: obj = ModelCheckpoint(filepath, monitor, filename_fcn)