added early epoch stopping hook
This commit is contained in:
parent
8eca3ffa41
commit
86261b7404
|
@ -266,6 +266,10 @@ class Trainer(TrainerIO):
|
|||
if met_batch_limit:
|
||||
break
|
||||
|
||||
# give model a chance to end epoch early
|
||||
if self.model.should_stop_epoch():
|
||||
break
|
||||
|
||||
# ---------------
|
||||
# RUN TRAIN STEP
|
||||
# ---------------
|
||||
|
|
|
@ -18,3 +18,6 @@ class ModelHooks(torch.nn.Module):
|
|||
|
||||
def on_post_performance_check(self):
|
||||
pass
|
||||
|
||||
def should_stop_epoch(self):
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue