Shortcuts

EarlyStoppingHook

class mmengine.hooks.EarlyStoppingHook(monitor, rule=None, min_delta=0.1, strict=False, check_finite=True, patience=5, stopping_threshold=None)[source]

Early stop the training when the monitored metric reached a plateau.

Parameters
  • monitor (str) – The monitored metric key to decide early stopping.

  • rule (str, optional) – Comparison rule. Options are ‘greater’, ‘less’. Defaults to None.

  • min_delta (float, optional) – Minimum difference to continue the training. Defaults to 0.01.

  • strict (bool, optional) – Whether to crash the training when monitor is not found in the metrics. Defaults to False.

  • check_finite (bool) – Whether to stop training when the monitor becomes NaN or infinite. Defaults to True.

  • patience (int, optional) – The times of validation with no improvement after which training will be stopped. Defaults to 5.

  • stopping_threshold – Stop training immediately once the monitored quantity reaches this threshold. Defaults to None.

after_val_epoch(runner, metrics)[source]

Decide whether to stop the training process.

Parameters
  • runner (Runner) – The runner of the training process.

  • metrics (dict) – Evaluation results of all metrics

before_run(runner)[source]

Check stop_training variable in runner.train_loop.

Parameters

runner (Runner) – The runner of the training process.

Return type

None

Read the Docs v: v0.7.0
Versions
latest
stable
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.