nnsvs.train_util.save_checkpoint

nnsvs.train_util.save_checkpoint(logger, out_dir, model, optimizer, lr_scheduler, epoch, is_best=False, postfix='')[source]

Save a checkpoint.

Parameters:
  • logger (logging.Logger) – Logger.

  • out_dir (str) – Output directory.

  • model (nn.Module) – Model.

  • optimizer (Optimizer) – Optimizer.

  • lr_scheduler (LRScheduler) – Learning rate scheduler.

  • epoch (int) – Current epoch.

  • is_best (bool, optional) – Whether or not the current model is the best. Defaults to False.

  • postfix (str, optional) – Postfix. Defaults to “”.