self._last_saved_at_epoch = self._epoch_count
// Save the state dictionary
torch.save(self.get_config(exclude_loader=exclude_loader),
os.path.join(self._save_to_directory, "checkpoint.pytorch"),
pickle_module=dill)
if self._is_iteration_with_best_validation_score and stash_best_checkpoint:
// Do the stashin"
After Change
if self._is_iteration_with_best_validation_score and stash_best_checkpoint:
// Do the stashin"
shutil.copyfile(self._fname_checkpoint, self._fname_best)
// This is required to prevent an infinite save loop?
self._is_iteration_with_best_validation_score = False
self.print("Saved to {}.".format(self._save_to_directory))