code: def __init__(
      self,
      in_channels=[1024, 512, 256],
      num_classes=80,
      act="swish",
      fpn_strides=(32, 16, 8),
      grid_cell_scale=5.0,
      grid_cell_offset=0.5,
      reg_max=16,
      reg_range=None,
      static_assigner_epoch=4,
      use_varifocal_loss=True,
      static_assigner="ATSSAssigner",
      assigner="TaskAlignedAssigner",
      nms="MultiClassNMS",
      eval_size=None,
      loss_weight={
          "class": 1.0,
          "iou": 2.5,
          "dfl": 0.5,
      },
      trt=False,
      attn_conv="convbn",
      exclude_nms=False,
      exclude_post_process=False,
      use_shared_conv=True,
      for_distill=False,
  ):
      super(PPYOLOEHead, self).__init__()
      assert len(in_channels) > 0, "len(in_channels) should > 0"
      self.in_channels = in_channels
      self.num_classes = num_classes
      self.fpn_strides = fpn_strides
      self.grid_cell_scale = grid_cell_scale
      self.grid_cell_offset = grid_cell_offset
      if reg_range:
          self.sm_use = True
          self.reg_range = reg_range
      else:
          self.sm_use = False
          self.reg_range = (0, reg_max + 1)
      self.reg_channels = self.reg_range[1] - self.reg_range[0]
      self.iou_loss = GIoULoss()
      self.loss_weight = loss_weight
      self.use_varifocal_loss = use_varifocal_loss
      self.eval_size = eval_size
  
      self.static_assigner_epoch = static_assigner_epoch
      self.static_assigner = static_assigner
      self.assigner = assigner
      self.nms = nms
      if isinstance(self.nms, MultiClassNMS) and trt:
          self.nms.trt = trt
      self.exclude_nms = exclude_nms
      self.exclude_post_process = exclude_post_process
      self.use_shared_conv = use_shared_conv
      self.for_distill = for_distill
      self.is_teacher = False
  
      # stem
      self.stem_cls = nn.LayerList()
      self.stem_reg = nn.LayerList()
      act = (
          get_act_fn(act, trt=trt)
          if act is None or isinstance(act, (str, dict))
          else act
      )
      for in_c in self.in_channels:
          self.stem_cls.append(
              ESEAttn(in_c, act=act, attn_conv=attn_conv)
          )
          self.stem_reg.append(
              ESEAttn(in_c, act=act, attn_conv=attn_conv)
          )
      # pred head
      self.pred_cls = nn.LayerList()
      self.pred_reg = nn.LayerList()
      for in_c in self.in_channels:
          self.pred_cls.append(
              nn.Conv2D(in_c, self.num_classes, 3, padding=1)
          )
          self.pred_reg.append(
              nn.Conv2D(in_c, 4 * self.reg_channels, 3, padding=1)
          )
      # projection conv
      self.proj_conv = nn.Conv2D(
          self.reg_channels, 1, 1, bias_attr=False
      )
      self.proj_conv.skip_quant = True
      self._init_weights()
  
      if self.for_distill:
          self.distill_pairs = {}
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from paddle import ParamAttr
  from paddle.nn.initializer import KaimingNormal
  from paddle.nn.initializer import Normal, Constant
  from ..bbox_utils import batch_distance2bbox
  from ..losses import GIoULoss
  from ..initializer import bias_init_with_prob, constant_, normal_
  from ..assigners.utils import generate_anchors_for_grid_cell
  from ppdet.modeling.backbones.cspresnet import ConvBNLayer, RepVggBlock
  from ppdet.modeling.ops import get_static_shape, get_act_fn
  from ppdet.modeling.layers import MultiClassNMS
label_desc: Use image node_id 1 to create a new PPYOLOEHead object from inherited base classes: nn with example: obj = PPYOLOEHead(in_channels, num_classes, act, fpn_strides, grid_cell_scale, grid_cell_offset, reg_max, reg_range, static_assigner_epoch, use_varifocal_loss, static_assigner, assigner, nms, eval_size, loss_weight, trt, attn_conv, exclude_nms, exclude_post_process, use_shared_conv, for_distill)