Shortcuts

ParamSchedulerHook

class mmengine.hooks.ParamSchedulerHook[源代码]

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

after_train_epoch(runner)[源代码]

Call step function for each scheduler after each training epoch.

参数

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

返回类型

None

after_train_iter(runner, batch_idx, data_batch=None, outputs=None)[源代码]

Call step function for each scheduler after each training iteration.

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

返回类型

None

after_val_epoch(runner, metrics=None)[源代码]

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

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

返回类型

None

备注

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.