Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Add English version document of the Training Engine #2797

Merged
merged 4 commits into from
Mar 30, 2023

Conversation

xiexinch
Copy link
Collaborator

Motivation

As title.

Modification

  • docs/en/advanced_guides/engine.md

# Engine
# Training Engine

MMEngine defines some [basic loop controllers](https:/open-mmlab/mmengine/blob/main/mmengine/runner/loops.py) such as epoch-based training loop (`EpochBasedTrainLoop`), iteration-based training loop (`IterBasedTrainLoop`), standard validation loop (`ValLoop`), and standard testing loop (`TestLoop`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MMEngine defines some [basic loop controllers](https:/open-mmlab/mmengine/blob/main/mmengine/runner/loops.py) such as epoch-based training loop (`EpochBasedTrainLoop`), iteration-based training loop (`IterBasedTrainLoop`), standard validation loop (`ValLoop`), and standard testing loop (`TestLoop`).
MMEngine defined some [basic loop controllers](https:/open-mmlab/mmengine/blob/main/mmengine/runner/loops.py) such as epoch-based training loop (`EpochBasedTrainLoop`), iteration-based training loop (`IterBasedTrainLoop`), standard validation loop (`ValLoop`), and standard testing loop (`TestLoop`).


MMEngine defines some [basic loop controllers](https:/open-mmlab/mmengine/blob/main/mmengine/runner/loops.py) such as epoch-based training loop (`EpochBasedTrainLoop`), iteration-based training loop (`IterBasedTrainLoop`), standard validation loop (`ValLoop`), and standard testing loop (`TestLoop`).

OpenMMLab's algorithm libraries like MMSegmentation abstract model training, testing, and inference as executors (`Runner`) to handle. Users can use the default executor in MMEngine directly or modify the executor to meet customized needs. This document mainly introduces how users can configure existing running settings, hooks, and optimizers' basic concepts and usage methods.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OpenMMLab's algorithm libraries like MMSegmentation abstract model training, testing, and inference as executors (`Runner`) to handle. Users can use the default executor in MMEngine directly or modify the executor to meet customized needs. This document mainly introduces how users can configure existing running settings, hooks, and optimizers' basic concepts and usage methods.
OpenMMLab's algorithm libraries like MMSegmentation abstract model training, testing, and inference as `Runner` to handle. Users can use the default runner in MMEngine directly or modify the runner to meet customized needs. This document mainly introduces how users can configure existing running settings, hooks, and optimizers' basic concepts and usage methods.


### Configuring Training Length

Loop controllers refer to the execution process during training, validation, and testing. They use `train_cfg`, `val_cfg`, and `test_cfg` to build these processes in the configuration file. MMSegmentation sets commonly used training lengths in the configs/_base_/schedules folder's train_cfg.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Loop controllers refer to the execution process during training, validation, and testing. They use `train_cfg`, `val_cfg`, and `test_cfg` to build these processes in the configuration file. MMSegmentation sets commonly used training lengths in the configs/_base_/schedules folder's train_cfg.
Loop controllers refer to the execution process during training, validation, and testing. `train_cfg`, `val_cfg`, and `test_cfg` are used to build these processes in the configuration file. MMSegmentation sets commonly used training iterations in `train_cfg` under the `configs/_base_/schedules` folder.

docs/en/advanced_guides/engine.md Outdated Show resolved Hide resolved
docs/en/advanced_guides/engine.md Outdated Show resolved Hide resolved

Custom hooks are defined in the configuration through `custom_hooks`, and `Runner` registers them using the [`register_custom_hooks`](https:/open-mmlab/mmengine/blob/main/mmengine/runner/runner.py#L1820) method.

The priority of custom hooks needs to be set in the configuration file; if not set, it will be set to `NORMAL` by default. The following are some custom hooks implemented in MMEngine:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The priority of custom hooks needs to be set in the configuration file; if not set, it will be set to `NORMAL` by default. The following are some custom hooks implemented in MMEngine:
The priority of custom hooks needs to be set in the configuration file; if not, it will be set to `NORMAL` by default. The following are some custom hooks implemented in MMEngine:


### SegVisualizationHook

MMSegmentation implements [`SegVisualizationHook`](https:/open-mmlab/mmsegmentation/blob/dev-1.x/mmseg/engine/hooks/visualization_hook.py#L17), which is used to visualize prediction results during validation and testing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MMSegmentation implements [`SegVisualizationHook`](https:/open-mmlab/mmsegmentation/blob/dev-1.x/mmseg/engine/hooks/visualization_hook.py#L17), which is used to visualize prediction results during validation and testing.
MMSegmentation implemented [`SegVisualizationHook`](https:/open-mmlab/mmsegmentation/blob/dev-1.x/mmseg/engine/hooks/visualization_hook.py#L17), which is used to visualize prediction results during validation and testing.


OpenMMLab's algorithm libraries like MMSegmentation abstract model training, testing, and inference as executors (`Runner`) to handle. Users can use the default executor in MMEngine directly or modify the executor to meet customized needs. This document mainly introduces how users can configure existing running settings, hooks, and optimizers' basic concepts and usage methods.

## Configuring Running Settings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Configuring Running Settings
## Configuring Runtime Settings


## Optimizer

In the previous configuration and runtime settings, we provided a simple example of configuring the training optimizer. This section will further detail how to configure optimizers in MMSegmentation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the previous configuration and runtime settings, we provided a simple example of configuring the training optimizer. This section will further detail how to configure optimizers in MMSegmentation.
In the previous configuration and runtime settings, we provided a simple example of configuring the training optimizer. This section will further detailly introduce how to configure optimizers in MMSegmentation.


### Optimizer Wrapper Constructor

The default optimizer wrapper constructor [`DefaultOptimWrapperConstructor`](https:/open-mmlab/mmengine/blob/main/mmengine/optim/optimizer/default_constructor.py#L19) builds the optimizer used in training based on the input `optim_wrapper` and the `paramwise_cfg` defined in the `optim_wrapper`. When the functionality of [`DefaultOptimWrapperConstructor`](https:/open-mmlab/mmengine/blob/main/mmengine/optim/optimizer/default_constructor.py#L19) does not meet the requirements, you can customize the optimizer wrapper constructor to implement the configuration of hyperparameters.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The default optimizer wrapper constructor [`DefaultOptimWrapperConstructor`](https:/open-mmlab/mmengine/blob/main/mmengine/optim/optimizer/default_constructor.py#L19) builds the optimizer used in training based on the input `optim_wrapper` and the `paramwise_cfg` defined in the `optim_wrapper`. When the functionality of [`DefaultOptimWrapperConstructor`](https:/open-mmlab/mmengine/blob/main/mmengine/optim/optimizer/default_constructor.py#L19) does not meet the requirements, you can customize the optimizer wrapper constructor to implement the configuration of hyperparameters.
The default optimizer wrapper constructor [`DefaultOptimWrapperConstructor`](https:/open-mmlab/mmengine/blob/main/mmengine/optim/optimizer/default_constructor.py#L19) builds the optimizer used in training based on the input `optim_wrapper` and `paramwise_cfg` defined in the `optim_wrapper`. When the functionality of [`DefaultOptimWrapperConstructor`](https:/open-mmlab/mmengine/blob/main/mmengine/optim/optimizer/default_constructor.py#L19) does not meet the requirements, you can customize the optimizer wrapper constructor to implement the configuration of hyperparameters.

@xiexinch xiexinch merged commit 1dd6581 into open-mmlab:dev-1.x Mar 30, 2023
@xiexinch xiexinch deleted the engine_en_doc branch March 30, 2023 06:19
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants