code: def __init__(
      self,
      scale=1.0,
      model_name="large",
      feature_maps=[6, 12, 15],
      with_extra_blocks=False,
      extra_block_filters=[
          [256, 512],
          [128, 256],
          [128, 256],
          [64, 128],
      ],
      lr_mult_list=[1.0, 1.0, 1.0, 1.0, 1.0],
      conv_decay=0.0,
      multiplier=1.0,
      norm_type="bn",
      norm_decay=0.0,
      freeze_norm=False,
  ):
      super(MobileNetV3, self).__init__()
      if isinstance(feature_maps, Integral):
          feature_maps = [feature_maps]
      if norm_type == "sync_bn" and freeze_norm:
          raise ValueError(
              "The norm_type should not be sync_bn when freeze_norm is True"
          )
      self.feature_maps = feature_maps
      self.with_extra_blocks = with_extra_blocks
      self.extra_block_filters = extra_block_filters
  
      inplanes = 16
      if model_name == "large":
          self.cfg = [
              # k, exp, c,  se,     nl,  s,
              [3, 16, 16, False, "relu", 1],
              [3, 64, 24, False, "relu", 2],
              [3, 72, 24, False, "relu", 1],
              [5, 72, 40, True, "relu", 2],  # RCNN output
              [5, 120, 40, True, "relu", 1],
              [5, 120, 40, True, "relu", 1],  # YOLOv3 output
              [3, 240, 80, False, "hard_swish", 2],  # RCNN output
              [3, 200, 80, False, "hard_swish", 1],
              [3, 184, 80, False, "hard_swish", 1],
              [3, 184, 80, False, "hard_swish", 1],
              [3, 480, 112, True, "hard_swish", 1],
              [3, 672, 112, True, "hard_swish", 1],  # YOLOv3 output
              [
                  5,
                  672,
                  160,
                  True,
                  "hard_swish",
                  2,
              ],  # SSD/SSDLite/RCNN output
              [5, 960, 160, True, "hard_swish", 1],
              [5, 960, 160, True, "hard_swish", 1],  # YOLOv3 output
          ]
      elif model_name == "small":
          self.cfg = [
              # k, exp, c,  se,     nl,  s,
              [3, 16, 16, True, "relu", 2],
              [3, 72, 24, False, "relu", 2],  # RCNN output
              [3, 88, 24, False, "relu", 1],  # YOLOv3 output
              [5, 96, 40, True, "hard_swish", 2],  # RCNN output
              [5, 240, 40, True, "hard_swish", 1],
              [5, 240, 40, True, "hard_swish", 1],
              [5, 120, 48, True, "hard_swish", 1],
              [5, 144, 48, True, "hard_swish", 1],  # YOLOv3 output
              [
                  5,
                  288,
                  96,
                  True,
                  "hard_swish",
                  2,
              ],  # SSD/SSDLite/RCNN output
              [5, 576, 96, True, "hard_swish", 1],
              [5, 576, 96, True, "hard_swish", 1],  # YOLOv3 output
          ]
      else:
          raise NotImplementedError(
              "mode[{}_model] is not implemented!".format(model_name)
          )
  
      if multiplier != 1.0:
          self.cfg[-3][2] = int(self.cfg[-3][2] * multiplier)
          self.cfg[-2][1] = int(self.cfg[-2][1] * multiplier)
          self.cfg[-2][2] = int(self.cfg[-2][2] * multiplier)
          self.cfg[-1][1] = int(self.cfg[-1][1] * multiplier)
          self.cfg[-1][2] = int(self.cfg[-1][2] * multiplier)
  
      self.conv1 = ConvBNLayer(
          in_c=3,
          out_c=make_divisible(inplanes * scale),
          filter_size=3,
          stride=2,
          padding=1,
          num_groups=1,
          act="hard_swish",
          lr_mult=lr_mult_list[0],
          conv_decay=conv_decay,
          norm_type=norm_type,
          norm_decay=norm_decay,
          freeze_norm=freeze_norm,
          name="conv1",
      )
  
      self._out_channels = []
      self.block_list = []
      i = 0
      inplanes = make_divisible(inplanes * scale)
      for k, exp, c, se, nl, s in self.cfg:
          lr_idx = min(i // 3, len(lr_mult_list) - 1)
          lr_mult = lr_mult_list[lr_idx]
  
          # for SSD/SSDLite, first head input is after ResidualUnit expand_conv
          return_list = (
              self.with_extra_blocks and i + 2 in self.feature_maps
          )
  
          block = self.add_sublayer(
              "conv" + str(i + 2),
              sublayer=ResidualUnit(
                  in_c=inplanes,
                  mid_c=make_divisible(scale * exp),
                  out_c=make_divisible(scale * c),
                  filter_size=k,
                  stride=s,
                  use_se=se,
                  act=nl,
                  lr_mult=lr_mult,
                  conv_decay=conv_decay,
                  norm_type=norm_type,
                  norm_decay=norm_decay,
                  freeze_norm=freeze_norm,
                  return_list=return_list,
                  name="conv" + str(i + 2),
              ),
          )
          self.block_list.append(block)
          inplanes = make_divisible(scale * c)
          i += 1
          self._update_out_channels(
              make_divisible(scale * exp) if return_list else inplanes,
              i + 1,
              feature_maps,
          )
  
      if self.with_extra_blocks:
          self.extra_block_list = []
          extra_out_c = make_divisible(scale * self.cfg[-1][1])
          lr_idx = min(i // 3, len(lr_mult_list) - 1)
          lr_mult = lr_mult_list[lr_idx]
  
          conv_extra = self.add_sublayer(
              "conv" + str(i + 2),
              sublayer=ConvBNLayer(
                  in_c=inplanes,
                  out_c=extra_out_c,
                  filter_size=1,
                  stride=1,
                  padding=0,
                  num_groups=1,
                  act="hard_swish",
                  lr_mult=lr_mult,
                  conv_decay=conv_decay,
                  norm_type=norm_type,
                  norm_decay=norm_decay,
                  freeze_norm=freeze_norm,
                  name="conv" + str(i + 2),
              ),
          )
          self.extra_block_list.append(conv_extra)
          i += 1
          self._update_out_channels(extra_out_c, i + 1, feature_maps)
  
          for j, block_filter in enumerate(self.extra_block_filters):
              in_c = (
                  extra_out_c
                  if j == 0
                  else self.extra_block_filters[j - 1][1]
              )
              conv_extra = self.add_sublayer(
                  "conv" + str(i + 2),
                  sublayer=ExtraBlockDW(
                      in_c,
                      block_filter[0],
                      block_filter[1],
                      stride=2,
                      lr_mult=lr_mult,
                      conv_decay=conv_decay,
                      norm_type=norm_type,
                      norm_decay=norm_decay,
                      freeze_norm=freeze_norm,
                      name="conv" + str(i + 2),
                  ),
              )
              self.extra_block_list.append(conv_extra)
              i += 1
              self._update_out_channels(
                  block_filter[1], i + 1, feature_maps
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from ppdet.core.workspace import register, serializable
  from numbers import Integral
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new MobileNetV3 object from inherited base classes: nn with example: obj = MobileNetV3(scale, model_name, feature_maps, with_extra_blocks, extra_block_filters, lr_mult_list, conv_decay, multiplier, norm_type, norm_decay, freeze_norm)