added log saving when early epoch stop

This commit is contained in:
William Falcon 2019-04-23 11:12:01 -04:00
parent 0637d8e7a5
commit f881bf6750
1 changed files with 2 additions and 2 deletions

View File

@ -281,11 +281,11 @@ class Trainer(TrainerIO):
self.__run_validation() self.__run_validation()
# when batch should be saved # when batch should be saved
if (batch_nb + 1) % self.log_save_interval == 0: if (batch_nb + 1) % self.log_save_interval == 0 or early_stop_epoch:
self.experiment.save() self.experiment.save()
# when metrics should be logged # when metrics should be logged
if batch_nb % self.add_log_row_interval == 0: if batch_nb % self.add_log_row_interval == 0 or early_stop_epoch:
# count items in memory # count items in memory
# nb_params, nb_tensors = count_mem_items() # nb_params, nb_tensors = count_mem_items()