Shortcuts

ReduceLRSchedulerHook

class mmedit.engine.hooks.ReduceLRSchedulerHook(val_metric: Optional[str] = None, by_epoch=True, interval=1)[source]

A hook to update learning rate.

Parameters
  • val_metric (str) – The metric of validation. If val_metric is not None, we check val_metric to reduce learning. Default: None.

  • by_epoch (bool) – Whether to update by epoch. Default: True.

  • interval (int) – The interval of iterations to update. Default: 1.

after_train_epoch(runner: mmengine.runner.runner.Runner)[source]

Call step function for each scheduler after each train epoch.

Parameters

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

after_train_iter(runner: mmengine.runner.runner.Runner, batch_idx: int, data_batch: Optional[Sequence[dict]] = None, outputs: Optional[dict] = None) None[source]

Call step function for each scheduler after each iteration.

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

  • batch_idx (int) – The index of the current batch in the train loop.

  • data_batch (Sequence[dict], optional) – Data from dataloader. In order to keep this interface consistent with other hooks, we keep data_batch here. Defaults to None.

  • outputs (dict, optional) – Outputs from model. In order to keep this interface consistent with other hooks, we keep data_batch here. Defaults to None.

after_val_epoch(runner, metrics: Optional[Dict[str, float]] = None)[source]

Call step function for each scheduler after each validation epoch.

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

  • metrics (dict, optional) – The metrics of validation. Default: None.

Read the Docs v: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.