Shortcuts

EarlyStoppingHook

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

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

参数:
  • 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.

备注

New in version 0.7.0.

after_val_epoch(runner, metrics)[源代码]

Decide whether to stop the training process.

参数:
  • runner (Runner) – The runner of the training process.

  • metrics (dict) – Evaluation results of all metrics

before_run(runner)[源代码]

Check stop_training variable in runner.train_loop.

参数:

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

返回类型:

None

Read the Docs v: latest
Versions
latest
stable
v0.10.3
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.