early epoch stopping

This commit is contained in:
William Falcon 2019-04-23 08:57:58 -04:00
parent 95aee7ff96
commit 2514f62913
1 changed files with 2 additions and 0 deletions

View File

@ -309,6 +309,7 @@ class Trainer(TrainerIO):
if self.__is_function_implemented('on_batch_end'): if self.__is_function_implemented('on_batch_end'):
self.model.on_batch_end() self.model.on_batch_end()
# end epoch early
if early_stop_epoch: if early_stop_epoch:
break break
@ -326,6 +327,7 @@ class Trainer(TrainerIO):
if stop: if stop:
return return
def __run_tng_batch(self, data_batch): def __run_tng_batch(self, data_batch):
if data_batch is None: if data_batch is None:
return 0 return 0