Shortcuts

mmagic.engine.hooks.reduce_lr_scheduler_hook

Module Contents

Classes

ReduceLRSchedulerHook

A hook to update learning rate.

Attributes

DATA_BATCH

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

Bases: mmengine.hooks.ParamSchedulerHook

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.

_calculate_average_value()[source]
after_train_epoch(runner: mmengine.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, batch_idx: int, data_batch: DATA_BATCH = 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: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.