mmengine.model¶
Module¶
Base module for all modules in openmmlab. |
|
ModuleDict in openmmlab. |
|
ModuleList in openmmlab. |
|
Sequential module in openmmlab. |
Model¶
Base class for all algorithmic models. |
|
Base data pre-processor used for copying data to the target device. |
|
Image pre-processor for normalization and bgr to rgb conversion. |
|
Base model for inference with test-time augmentation. |
EMA¶
A base class for averaging model weights. |
|
Implements the exponential moving average (EMA) of the model. |
|
Exponential moving average (EMA) with momentum annealing strategy. |
|
Implements the stochastic weight averaging (SWA) of the model. |
Model Wrapper¶
A distributed model wrapper used for training,testing and validation in loop. |
|
A DistributedDataParallel wrapper for models in MMGeneration. |
|
A wrapper for sharding Module parameters across data parallel workers. |
Check if a module is a model wrapper. |
Weight Initialization¶
Initialize module parameters with constant values. |
|
Initialize module parameters with the values according to the method described in the paper below. |
|
Initialize module parameters with the values drawn from the normal distribution \(\mathcal{N}(\text{mean}, \text{std}^2)\). |
|
Initialize module by loading a pretrained model. |
|
Initialize module parameters with the values drawn from the normal distribution \(\mathcal{N}(\text{mean}, \text{std}^2)\) with values outside \([a, b]\). |
|
Initialize module parameters with values drawn from the uniform distribution \(\mathcal{U}(a, b)\). |
|
Initialize module parameters with values according to the method described in the paper below. |
initialize conv/fc bias value according to a given probability value. |
|
Initialize a module. |
|
Update the _params_init_info in the module if the value of parameters are changed. |
|
Utils¶
Merge all dictionaries into one dictionary. |
|
Stack multiple tensors to form a batch and pad the tensor to the max shape use the right bottom padding mode in these images. |
|
Helper function to convert all SyncBatchNorm (SyncBN) and mmcv.ops.sync_bn.SyncBatchNorm`(MMSyncBN) layers in the model to `BatchNormXd layers. |
|
Helper function to convert all BatchNorm layers in the model to SyncBatchNorm (SyncBN) or mmcv.ops.sync_bn.SyncBatchNorm (MMSyncBN) layers. |