class_docstr: Simple Checkpoint to save model weights during training. This class is mostly superceded by ModelCheckpoint which provides flexible saving functionality.
  
  :param file: (string):
      file to which model will be saved.
      It can be written 'filename_{epoch}_{loss}' and those
      values will be filled in before saving.
  :param monitor: (string in {'val_loss', 'loss'}):
      whether to monitor train or val loss
  :param save_best_only: (bool):
      whether to only save if monitored value has improved
  :param save_weights_only: (bool):
      whether to save entire model or just weights
      NOTE: only `True` is supported at the moment
  :param max_save: (integer > 0 or -1):
      the max number of models to save. Older model checkpoints
      will be overwritten if necessary. Set equal to -1 to have
      no limit
  :param verbose: (integer in {0, 1}):
      verbosity level
code: def __init__(
      self,
      directory,
      filename="ckpt.pth.tar",
      monitor="val_loss",
      save_best_only=False,
      save_weights_only=True,
      max_save=-1,
      verbose=0,
  ):
      if directory.startswith("~"):
          directory = os.path.expanduser(directory)
      self.directory = directory
      self.filename = filename
      self.file = os.path.join(self.directory, self.filename)
      self.monitor = monitor
      self.save_best_only = save_best_only
      self.save_weights_only = save_weights_only
      self.max_save = max_save
      self.verbose = verbose
  
      if self.max_save > 0:
          self.old_files = []
  
      # mode = 'min' only supported
      self.best_loss = float("inf")
      super(SimpleModelCheckpoint, self).__init__()
  
file_path: pywick/pywick/callbacks/SimpleModelCheckpoint.py
imports: import os
  import shutil
  import torch
  from .None import Callback
label_desc: Use image node_id 1 to create a new SimpleModelCheckpoint object from inherited base classes: Callback with example: obj = SimpleModelCheckpoint(directory, filename, monitor, save_best_only, save_weights_only, max_save, verbose)