code: def __init__(self, scale, in_channels=3, pretrained=None):
      super(GhostNet, self).__init__()
      self.cfgs = [
          # k, t, c, SE, s
          [3, 16, 16, 0, 1],
          [3, 48, 24, 0, 2],
          [3, 72, 24, 0, 1],  # x4
          [5, 72, 40, 1, 2],
          [5, 120, 40, 1, 1],  # x8
          [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],  # x16
          [5, 672, 160, 1, 2],
          [5, 960, 160, 0, 1],
          [5, 960, 160, 1, 1],
          [5, 960, 160, 0, 1],
          [5, 960, 160, 1, 1],  # x32
      ]
      self.scale = scale
      self.pretrained = pretrained
  
      output_channels = int(self._make_divisible(16 * self.scale, 4))
      self.conv1 = ConvBNLayer(
          in_channels=in_channels,
          out_channels=output_channels,
          kernel_size=3,
          stride=2,
          groups=1,
          act="relu",
          name="conv1",
      )
  
      # build inverted residual blocks
      self.out_index = [2, 4, 10, 15]
      self.feat_channels = []
      self.ghost_bottleneck_list = []
      for idx, (k, exp_size, c, use_se, s) in enumerate(self.cfgs):
          in_channels = output_channels
          output_channels = int(self._make_divisible(c * self.scale, 4))
          hidden_dim = int(
              self._make_divisible(exp_size * self.scale, 4)
          )
          ghost_bottleneck = self.add_sublayer(
              name="_ghostbottleneck_" + str(idx),
              sublayer=GhostBottleneck(
                  in_channels=in_channels,
                  hidden_dim=hidden_dim,
                  output_channels=output_channels,
                  kernel_size=k,
                  stride=s,
                  use_se=use_se,
                  name="_ghostbottleneck_" + str(idx),
              ),
          )
          self.ghost_bottleneck_list.append(ghost_bottleneck)
          if idx in self.out_index:
              self.feat_channels.append(output_channels)
  
      self.init_weight()
  
imports: import math
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import Conv2D, BatchNorm, AdaptiveAvgPool2D, Linear
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import Uniform, KaimingNormal
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils, logger
label_desc: Use image node_id 1 to create a new GhostNet object from inherited base classes: nn with example: obj = GhostNet(scale, in_channels, pretrained)