From 2514f62913b2cd1de06dc2f62abdcc92384f255b Mon Sep 17 00:00:00 2001 From: William Falcon Date: Tue, 23 Apr 2019 08:57:58 -0400 Subject: [PATCH] early epoch stopping --- pytorch_lightning/models/trainer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index 7bcf98b9b4..5edc5ad0c3 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -309,6 +309,7 @@ class Trainer(TrainerIO): if self.__is_function_implemented('on_batch_end'): self.model.on_batch_end() + # end epoch early if early_stop_epoch: break @@ -326,6 +327,7 @@ class Trainer(TrainerIO): if stop: return + def __run_tng_batch(self, data_batch): if data_batch is None: return 0