Shortcuts

RuntimeInfoHook

class mmengine.hooks.RuntimeInfoHook[source]

A hook that updates runtime information into message hub.

E.g. epoch, iter, max_epochs, and max_iters for the training state. Components that cannot access the runner can get runtime information through the message hub.

after_test(runner)[source]

All subclasses should override this method, if they need any operations after testing.

Parameters:

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

Return type:

None

after_test_epoch(runner, metrics=None)[source]

All subclasses should override this method, if they need any operations after each test epoch.

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

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

Return type:

None

after_train(runner)[source]

All subclasses should override this method, if they need any operations after train.

Parameters:

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

Return type:

None

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

Update log_vars in model outputs every 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. Defaults to None.

  • outputs (dict, optional) – Outputs from model. Defaults to None.

Return type:

None

after_val(runner)[source]

All subclasses should override this method, if they need any operations after validation.

Parameters:

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

Return type:

None

after_val_epoch(runner, metrics=None)[source]

All subclasses should override this method, if they need any operations 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

before_run(runner)[source]

Update metainfo.

Parameters:

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

Return type:

None

before_test(runner)[source]

All subclasses should override this method, if they need any operations before testing.

Parameters:

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

Return type:

None

before_train(runner)[source]

Update resumed training state.

Parameters:

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

Return type:

None

before_train_epoch(runner)[source]

Update current epoch information before every epoch.

Parameters:

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

Return type:

None

before_train_iter(runner, batch_idx, data_batch=None)[source]

Update current iter and learning rate information before every 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. Defaults to None.

Return type:

None

before_val(runner)[source]

All subclasses should override this method, if they need any operations before validation.

Parameters:

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

Return type:

None

Read the Docs v: v0.10.4
Versions
latest
stable
v0.10.4
v0.10.3
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
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.