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 (float, optional) – Stop training immediately once the monitored quantity reaches this threshold. Defaults to None.

Note

New in version 0.7.0.

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: stable
Versions
latest
stable
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.