code: def __init__(
      self,
      norm_type="bn",
      norm_decay=0.0,
      conv_decay=0.0,
      scale=1,
      conv_learning_rate=1.0,
      feature_maps=[4, 6, 13],
      with_extra_blocks=False,
      extra_block_filters=[
          [256, 512],
          [128, 256],
          [128, 256],
          [64, 128],
      ],
  ):
      super(MobileNet, self).__init__()
      if isinstance(feature_maps, Integral):
          feature_maps = [feature_maps]
      self.feature_maps = feature_maps
      self.with_extra_blocks = with_extra_blocks
      self.extra_block_filters = extra_block_filters
  
      self._out_channels = []
  
      self.conv1 = ConvBNLayer(
          in_channels=3,
          out_channels=int(32 * scale),
          kernel_size=3,
          stride=2,
          padding=1,
          conv_lr=conv_learning_rate,
          conv_decay=conv_decay,
          norm_decay=norm_decay,
          norm_type=norm_type,
          name="conv1",
      )
  
      self.dwsl = []
      dws21 = self.add_sublayer(
          "conv2_1",
          sublayer=DepthwiseSeparable(
              in_channels=int(32 * scale),
              out_channels1=32,
              out_channels2=64,
              num_groups=32,
              stride=1,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv2_1",
          ),
      )
      self.dwsl.append(dws21)
      self._update_out_channels(
          int(64 * scale), len(self.dwsl), feature_maps
      )
      dws22 = self.add_sublayer(
          "conv2_2",
          sublayer=DepthwiseSeparable(
              in_channels=int(64 * scale),
              out_channels1=64,
              out_channels2=128,
              num_groups=64,
              stride=2,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv2_2",
          ),
      )
      self.dwsl.append(dws22)
      self._update_out_channels(
          int(128 * scale), len(self.dwsl), feature_maps
      )
      # 1/4
      dws31 = self.add_sublayer(
          "conv3_1",
          sublayer=DepthwiseSeparable(
              in_channels=int(128 * scale),
              out_channels1=128,
              out_channels2=128,
              num_groups=128,
              stride=1,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv3_1",
          ),
      )
      self.dwsl.append(dws31)
      self._update_out_channels(
          int(128 * scale), len(self.dwsl), feature_maps
      )
      dws32 = self.add_sublayer(
          "conv3_2",
          sublayer=DepthwiseSeparable(
              in_channels=int(128 * scale),
              out_channels1=128,
              out_channels2=256,
              num_groups=128,
              stride=2,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv3_2",
          ),
      )
      self.dwsl.append(dws32)
      self._update_out_channels(
          int(256 * scale), len(self.dwsl), feature_maps
      )
      # 1/8
      dws41 = self.add_sublayer(
          "conv4_1",
          sublayer=DepthwiseSeparable(
              in_channels=int(256 * scale),
              out_channels1=256,
              out_channels2=256,
              num_groups=256,
              stride=1,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv4_1",
          ),
      )
      self.dwsl.append(dws41)
      self._update_out_channels(
          int(256 * scale), len(self.dwsl), feature_maps
      )
      dws42 = self.add_sublayer(
          "conv4_2",
          sublayer=DepthwiseSeparable(
              in_channels=int(256 * scale),
              out_channels1=256,
              out_channels2=512,
              num_groups=256,
              stride=2,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv4_2",
          ),
      )
      self.dwsl.append(dws42)
      self._update_out_channels(
          int(512 * scale), len(self.dwsl), feature_maps
      )
      # 1/16
      for i in range(5):
          tmp = self.add_sublayer(
              "conv5_" + str(i + 1),
              sublayer=DepthwiseSeparable(
                  in_channels=int(512 * scale),
                  out_channels1=512,
                  out_channels2=512,
                  num_groups=512,
                  stride=1,
                  scale=scale,
                  conv_lr=conv_learning_rate,
                  conv_decay=conv_decay,
                  norm_decay=norm_decay,
                  norm_type=norm_type,
                  name="conv5_" + str(i + 1),
              ),
          )
          self.dwsl.append(tmp)
          self._update_out_channels(
              int(512 * scale), len(self.dwsl), feature_maps
          )
      dws56 = self.add_sublayer(
          "conv5_6",
          sublayer=DepthwiseSeparable(
              in_channels=int(512 * scale),
              out_channels1=512,
              out_channels2=1024,
              num_groups=512,
              stride=2,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv5_6",
          ),
      )
      self.dwsl.append(dws56)
      self._update_out_channels(
          int(1024 * scale), len(self.dwsl), feature_maps
      )
      # 1/32
      dws6 = self.add_sublayer(
          "conv6",
          sublayer=DepthwiseSeparable(
              in_channels=int(1024 * scale),
              out_channels1=1024,
              out_channels2=1024,
              num_groups=1024,
              stride=1,
              scale=scale,
              conv_lr=conv_learning_rate,
              conv_decay=conv_decay,
              norm_decay=norm_decay,
              norm_type=norm_type,
              name="conv6",
          ),
      )
      self.dwsl.append(dws6)
      self._update_out_channels(
          int(1024 * scale), len(self.dwsl), feature_maps
      )
  
      if self.with_extra_blocks:
          self.extra_blocks = []
          for i, block_filter in enumerate(self.extra_block_filters):
              in_c = (
                  1024 if i == 0 else self.extra_block_filters[i - 1][1]
              )
              conv_extra = self.add_sublayer(
                  "conv7_" + str(i + 1),
                  sublayer=ExtraBlock(
                      in_c,
                      block_filter[0],
                      block_filter[1],
                      conv_lr=conv_learning_rate,
                      conv_decay=conv_decay,
                      norm_decay=norm_decay,
                      norm_type=norm_type,
                      name="conv7_" + str(i + 1),
                  ),
              )
              self.extra_blocks.append(conv_extra)
              self._update_out_channels(
                  block_filter[1],
                  len(self.dwsl) + len(self.extra_blocks),
                  feature_maps,
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import KaimingNormal
  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 MobileNet object from inherited base classes: nn with example: obj = MobileNet(norm_type, norm_decay, conv_decay, scale, conv_learning_rate, feature_maps, with_extra_blocks, extra_block_filters)