otx.algo.callbacks.adaptive_early_stopping#
Callback for early stopping with warmup possibility.
Classes
|
EarlyStoppingWithWarmup callback. |
- class otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup(monitor: str, min_delta: float = 0.0, patience: int = 10, verbose: bool = False, mode: str = 'min', strict: bool = True, check_finite: bool = True, stopping_threshold: float | None = None, divergence_threshold: float | None = None, check_on_train_epoch_end: bool | None = None, log_rank_zero_only: bool = False, warmup_iters: int = 100, warmup_epochs: int = 3)[source]#
Bases:
EarlyStopping
EarlyStoppingWithWarmup callback.
EarlyStoppingWithWarmup callback.
- Parameters:
monitor (str) – The metric to monitor.
min_delta (float, optional) – Minimum change in the monitored quantity to qualify as an improvement. Defaults to 0.0.
patience (int, optional) – Number of epochs with no improvement after which training will be stopped. Defaults to 3.
verbose (bool, optional) – If True, prints messages to stdout. Defaults to False.
mode (str, optional) – One of {“min”, “max”}. In “min” mode, training will stop when the quantity monitored has stopped decreasing. In “max” mode, it will stop when the quantity monitored has stopped increasing. Defaults to “min”.
strict (bool, optional) – If True, the monitored quantity must improve according to the mode for it to be considered an improvement. Defaults to True.
check_finite (bool, optional) – If True, check that the monitored quantity is finite before considering an improvement. Defaults to True.
stopping_threshold (float | None, optional) – The threshold to stop training. Defaults to None.
divergence_threshold (float | None, optional) – The threshold for divergence detection. Defaults to None.
check_on_train_epoch_end (bool | None, optional) – If True, checks the stopping criterion on train_epoch_end. Defaults to None.
log_rank_zero_only (bool, optional) – If True, logs should only be printed from rank 0. Defaults to False.
warmup_iters (int, optional) – Number of warmup iterations. Defaults to 100.
warmup_epochs (int, optional) – Number of warmup epochs. Defaults to 3.