Shortcuts

mmedit.engine.hooks.reduce_lr_scheduler_hook

Module Contents

Classes

ReduceLRSchedulerHook

A hook to update learning rate.

Attributes

DATA_BATCH

mmedit.engine.hooks.reduce_lr_scheduler_hook.DATA_BATCH[源代码]
class mmedit.engine.hooks.reduce_lr_scheduler_hook.ReduceLRSchedulerHook(val_metric: str = None, by_epoch=True, interval=1)[源代码]

Bases: mmengine.hooks.ParamSchedulerHook

A hook to update learning rate.

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

_calculate_average_value()[源代码]
after_train_epoch(runner: mmengine.runner.Runner)[源代码]

Call step function for each scheduler after each train epoch.

参数

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

after_train_iter(runner: mmengine.runner.Runner, batch_idx: int, data_batch: DATA_BATCH = None, outputs: Optional[dict] = None) None[源代码]

Call step function for each scheduler after each iteration.

参数
  • 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)[源代码]

Call step function for each scheduler after each validation epoch.

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

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

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

Free document hosting provided by Read the Docs.