Shortcuts

ParamSchedulerHook

class mmengine.hooks.ParamSchedulerHook[source]

A hook to update some hyper-parameters in optimizer, e.g., learning rate and momentum.

after_train_epoch(runner)[source]

Call step function for each scheduler after each training epoch.

Parameters

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

Return type

None

after_train_iter(runner, batch_idx, data_batch=None, outputs=None)[source]

Call step function for each scheduler after each training 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 (dict or tuple or list, optional) – Data from dataloader. In order to keep this interface consistent with other hooks, we keep data_batch here.

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

Return type

None

after_val_epoch(runner, metrics=None)[source]

Call step function for each scheduler which has attribute need_val_args after each validation epoch.

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

  • metrics (Dict[str, float], optional) – Evaluation results of all metrics on validation dataset. The keys are the names of the metrics, and the values are corresponding results.

Return type

None

Note

if runner.param_schedulers is not built before, the hook after_val_epoch will be skipped.

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.