class_docstr: PPHGNet
  Args:
      stem_channels: list. Stem channel list of PPHGNet.
      stage_config: dict. The configuration of each stage of PPHGNet. such as the number of channels, stride, etc.
      layer_num: int. Number of layers of HG_Block.
      use_last_conv: boolean. Whether to use a 1x1 convolutional layer before the classification layer.
      class_expand: int=2048. Number of channels for the last 1x1 convolutional layer.
      dropout_prob: float. Parameters of dropout, 0.0 means dropout is not used.
      class_num: int=1000. The number of classes.
  Returns:
      model: nn.Layer. Specific PPHGNet model depends on args.
class_docstr_tok: ["PPHGNet","Args",":","stem_channels",":","list",".","Stem","channel","list","of","PPHGNet",".","stage_config",":","dict",".","The","configuration","of","each","stage","of","PPHGNet",".","such","as","the","number","of","channels",",","stride",",","etc",".","layer_num",":","int",".","Number","of","layers","of","HG_Block",".","use_last_conv",":","boolean",".","Whether","to","use","a","1x1","convolutional","layer","before","the","classification","layer",".","class_expand",":","int=2048",".","Number","of","channels","for","the","last","1x1","convolutional","layer",".","dropout_prob",":","float",".","Parameters","of","dropout",",","0.0","means","dropout","is","not","used",".","class_num",":","int=1000",".","The","number","of","classes",".","Returns",":","model",":","nn.Layer",".","Specific","PPHGNet","model","depends","on","args","."]
code: def __init__(
      self,
      stem_channels,
      stage_config,
      layer_num,
      in_channels=3,
      det=False,
      out_indices=None,
  ):
      super().__init__()
      self.det = det
      self.out_indices = (
          out_indices if out_indices is not None else [0, 1, 2, 3]
      )
  
      # stem
      stem_channels.insert(0, in_channels)
      self.stem = nn.Sequential(
          *[
              ConvBNAct(
                  in_channels=stem_channels[i],
                  out_channels=stem_channels[i + 1],
                  kernel_size=3,
                  stride=2 if i == 0 else 1,
              )
              for i in range(len(stem_channels) - 1)
          ]
      )
  
      if self.det:
          self.pool = nn.MaxPool2D(kernel_size=3, stride=2, padding=1)
      # stages
      self.stages = nn.LayerList()
      self.out_channels = []
      for block_id, k in enumerate(stage_config):
          (
              in_channels,
              mid_channels,
              out_channels,
              block_num,
              downsample,
              stride,
          ) = stage_config[k]
          self.stages.append(
              HG_Stage(
                  in_channels,
                  mid_channels,
                  out_channels,
                  block_num,
                  layer_num,
                  downsample,
                  stride,
              )
          )
          if block_id in self.out_indices:
              self.out_channels.append(out_channels)
  
      if not self.det:
          self.out_channels = stage_config["stage4"][2]
  
      self._init_weights()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import KaimingNormal, Constant
  from paddle.nn import Conv2D, BatchNorm2D, ReLU, AdaptiveAvgPool2D, MaxPool2D
  from paddle.regularizer import L2Decay
  from paddle import ParamAttr
label_desc: Use image node_id 1 to create a new PPHGNet object from inherited base classes: nn with example: obj = PPHGNet(stem_channels, stage_config, layer_num, in_channels, det, out_indices)