deepr.hooks.EarlyStoppingHookFactory
- class deepr.hooks.EarlyStoppingHookFactory(metric, max_steps_without_improvement, min_steps=0, mode=BestMode.DECREASE, run_every_secs=None, run_every_steps=None, final_step=None)[source]
Early Stopping Hook Factory
- run_every_steps
If given, run early stopping hook every given steps.
Either run_every_secs or run_every_step should be given.
- Type:
int, Optional
- final_step
If given, will set the global_step to this value when early stopping.
This is a useful way to signal the end of training to the evaluator in the case of distributed training (early stopping causes issues with train_and_evaluate).
- Type:
int, Optional
- __init__(metric, max_steps_without_improvement, min_steps=0, mode=BestMode.DECREASE, run_every_secs=None, run_every_steps=None, final_step=None)[source]
Methods
__init__
(metric, max_steps_without_improvement)