class_docstr: MobileNetV3 backbone.
  
  This backbone is the improved implementation of `Searching for MobileNetV3
  <https://ieeexplore.ieee.org/document/9008835>`_.
  
  Args:
      arch (str): Architecture of mobilnetv3, from {'small', 'large'}.
          Default: 'small'.
      conv_cfg (dict): Config dict for convolution layer.
          Default: None, which means using conv2d.
      norm_cfg (dict): Config dict for normalization layer.
          Default: dict(type='BN').
      out_indices (tuple[int]): Output from which layer.
          Default: (0, 1, 12).
      frozen_stages (int): Stages to be frozen (all param fixed).
          Default: -1, which means not freezing any parameters.
      norm_eval (bool): Whether to set norm layers to eval mode, namely,
          freeze running stats (mean and var). Note: Effect on Batch Norm
          and its variants only. Default: False.
      with_cp (bool): Use checkpoint or not. Using checkpoint will save
          some memory while slowing down the training speed.
          Default: False.
class_docstr_tok: ["MobileNetV3","backbone",".","This","backbone","is","the","improved","implementation","of","`","Searching","for","MobileNetV3","<","https",":","\/\/ieeexplore.ieee.org\/document\/9008835",">","`","_",".","Args",":","arch","(","str",")",":","Architecture","of","mobilnetv3",",","from","{","'small","'",",","'large","'","}",".","Default",":","'small","'",".","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Default",":","None",",","which","means","using","conv2d",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","dict","(","type='BN","'",")",".","out_indices","(","tuple","[","int","]",")",":","Output","from","which","layer",".","Default",":","(","0",",","1",",","12",")",".","frozen_stages","(","int",")",":","Stages","to","be","frozen","(","all","param","fixed",")",".","Default",":","-1",",","which","means","not","freezing","any","parameters",".","norm_eval","(","bool",")",":","Whether","to","set","norm","layers","to","eval","mode",",","namely",",","freeze","running","stats","(","mean","and","var",")",".","Note",":","Effect","on","Batch","Norm","and","its","variants","only",".","Default",":","False",".","with_cp","(","bool",")",":","Use","checkpoint","or","not",".","Using","checkpoint","will","save","some","memory","while","slowing","down","the","training","speed",".","Default",":","False","."]
code: def __init__(
      self,
      arch="small",
      conv_cfg=None,
      norm_cfg=dict(type="BN"),
      out_indices=(0, 1, 12),
      frozen_stages=-1,
      reduction_factor=1,
      norm_eval=False,
      with_cp=False,
  ):
      super(MobileNetV3, self).__init__()
      assert arch in self.arch_settings
      assert isinstance(reduction_factor, int) and reduction_factor > 0
      assert mmcv.is_tuple_of(out_indices, int)
      for index in out_indices:
          if index not in range(0, len(self.arch_settings[arch]) + 2):
              raise ValueError(
                  "the item in out_indices must in "
                  f"range(0, {len(self.arch_settings[arch])+2}). "
                  f"But received {index}"
              )
  
      if frozen_stages not in range(
          -1, len(self.arch_settings[arch]) + 2
      ):
          raise ValueError(
              "frozen_stages must be in range(-1, "
              f"{len(self.arch_settings[arch])+2}). "
              f"But received {frozen_stages}"
          )
      self.arch = arch
      self.conv_cfg = conv_cfg
      self.norm_cfg = norm_cfg
      self.out_indices = out_indices
      self.frozen_stages = frozen_stages
      self.reduction_factor = reduction_factor
      self.norm_eval = norm_eval
      self.with_cp = with_cp
      self.layers = self._make_layer()
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/backbones/mobilenet_v3.py
imports: import logging
  import annotator.uniformer.mmcv
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule, constant_init, kaiming_init
  from annotator.uniformer.mmcv.cnn.bricks import Conv2dAdaptivePadding
  from annotator.uniformer.mmcv.runner import load_checkpoint
  from torch.nn.modules.batchnorm import _BatchNorm
  from ..builder import BACKBONES
  from ..utils import InvertedResidualV3
label_desc: Use image node_id 1 to create a new MobileNetV3 object from inherited base classes: nn with example: obj = MobileNetV3(arch, conv_cfg, norm_cfg, out_indices, frozen_stages, reduction_factor, norm_eval, with_cp)