code: def __init__(
      self,
      scale=1.3,
      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,
      norm_type="bn",
      norm_decay=0.0,
      freeze_norm=False,
  ):
      super(GhostNet, 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
      self.cfgs = [
          # k, t, c, SE, s
          [3, 16, 16, 0, 1],
          [3, 48, 24, 0, 2],
          [3, 72, 24, 0, 1],
          [5, 72, 40, 1, 2],
          [5, 120, 40, 1, 1],
          [3, 240, 80, 0, 2],
          [3, 200, 80, 0, 1],
          [3, 184, 80, 0, 1],
          [3, 184, 80, 0, 1],
          [3, 480, 112, 1, 1],
          [3, 672, 112, 1, 1],
          [5, 672, 160, 1, 2],  # SSDLite output
          [5, 960, 160, 0, 1],
          [5, 960, 160, 1, 1],
          [5, 960, 160, 0, 1],
          [5, 960, 160, 1, 1],
      ]
      self.scale = scale
      conv1_out_ch = int(make_divisible(inplanes * self.scale, 4))
      self.conv1 = ConvBNLayer(
          in_c=3,
          out_c=conv1_out_ch,
          filter_size=3,
          stride=2,
          padding=1,
          num_groups=1,
          act="relu",
          lr_mult=1.0,
          conv_decay=conv_decay,
          norm_type=norm_type,
          norm_decay=norm_decay,
          freeze_norm=freeze_norm,
          name="conv1",
      )
  
      # build inverted residual blocks
      self._out_channels = []
      self.ghost_bottleneck_list = []
      idx = 0
      inplanes = conv1_out_ch
      for k, exp_size, c, use_se, s in self.cfgs:
          lr_idx = min(idx // 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 idx + 2 in self.feature_maps
          )
  
          ghost_bottleneck = self.add_sublayer(
              "_ghostbottleneck_" + str(idx),
              sublayer=GhostBottleneck(
                  in_channels=inplanes,
                  hidden_dim=int(
                      make_divisible(exp_size * self.scale, 4)
                  ),
                  output_channels=int(
                      make_divisible(c * self.scale, 4)
                  ),
                  kernel_size=k,
                  stride=s,
                  use_se=use_se,
                  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="_ghostbottleneck_" + str(idx),
              ),
          )
          self.ghost_bottleneck_list.append(ghost_bottleneck)
          inplanes = int(make_divisible(c * self.scale, 4))
          idx += 1
          self._update_out_channels(
              int(make_divisible(exp_size * self.scale, 4))
              if return_list
              else inplanes,
              idx + 1,
              feature_maps,
          )
  
      if self.with_extra_blocks:
          self.extra_block_list = []
          extra_out_c = int(
              make_divisible(self.scale * self.cfgs[-1][1], 4)
          )
          lr_idx = min(idx // 3, len(lr_mult_list) - 1)
          lr_mult = lr_mult_list[lr_idx]
  
          conv_extra = self.add_sublayer(
              "conv" + str(idx + 2),
              sublayer=ConvBNLayer(
                  in_c=inplanes,
                  out_c=extra_out_c,
                  filter_size=1,
                  stride=1,
                  padding=0,
                  num_groups=1,
                  act="relu6",
                  lr_mult=lr_mult,
                  conv_decay=conv_decay,
                  norm_type=norm_type,
                  norm_decay=norm_decay,
                  freeze_norm=freeze_norm,
                  name="conv" + str(idx + 2),
              ),
          )
          self.extra_block_list.append(conv_extra)
          idx += 1
          self._update_out_channels(extra_out_c, idx + 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(idx + 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(idx + 2),
                  ),
              )
              self.extra_block_list.append(conv_extra)
              idx += 1
              self._update_out_channels(
                  block_filter[1], idx + 1, feature_maps
              )
  
imports: import math
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import AdaptiveAvgPool2D, Linear
  from paddle.nn.initializer import Uniform
  from ppdet.core.workspace import register, serializable
  from numbers import Integral
  from ..shape_spec import ShapeSpec
  from .mobilenet_v3 import make_divisible, ConvBNLayer
label_desc: Use image node_id 1 to create a new GhostNet object from inherited base classes: nn with example: obj = GhostNet(scale, feature_maps, with_extra_blocks, extra_block_filters, lr_mult_list, conv_decay, norm_type, norm_decay, freeze_norm)