class_docstr: SparsercnnHead
  Args:
      roi_input_shape (list[ShapeSpec]): The output shape of fpn
      num_classes (int): Number of classes,
      head_hidden_dim (int): The param of MultiHeadAttention,
      head_dim_feedforward (int): The param of MultiHeadAttention,
      nhead (int): The param of MultiHeadAttention,
      head_dropout (float): The p of dropout,
      head_cls (int): The number of class head,
      head_reg (int): The number of regressionhead,
      head_num_dynamic (int): The number of DynamicConv's param,
      head_num_heads (int): The number of RCNNHead,
      deep_supervision (int): wheather supervise the intermediate results,
      num_proposals (int): the number of proposals boxes and features
class_docstr_tok: ["SparsercnnHead","Args",":","roi_input_shape","(","list","[","ShapeSpec","]",")",":","The","output","shape","of","fpn","num_classes","(","int",")",":","Number","of","classes",",","head_hidden_dim","(","int",")",":","The","param","of","MultiHeadAttention",",","head_dim_feedforward","(","int",")",":","The","param","of","MultiHeadAttention",",","nhead","(","int",")",":","The","param","of","MultiHeadAttention",",","head_dropout","(","float",")",":","The","p","of","dropout",",","head_cls","(","int",")",":","The","number","of","class","head",",","head_reg","(","int",")",":","The","number","of","regressionhead",",","head_num_dynamic","(","int",")",":","The","number","of","DynamicConv","'s","param",",","head_num_heads","(","int",")",":","The","number","of","RCNNHead",",","deep_supervision","(","int",")",":","wheather","supervise","the","intermediate","results",",","num_proposals","(","int",")",":","the","number","of","proposals","boxes","and","features"]
code: def __init__(
      self,
      head_hidden_dim,
      head_dim_feedforward,
      nhead,
      head_dropout,
      head_cls,
      head_reg,
      head_dim_dynamic,
      head_num_dynamic,
      head_num_heads,
      deep_supervision,
      num_proposals,
      num_classes=80,
      loss_func="SparseRCNNLoss",
      roi_input_shape=None,
  ):
      super().__init__()
      assert (
          head_num_heads > 0
      ), f"At least one RoI Head is required, but {head_num_heads}."
  
      # Build RoI.
      box_pooler = self._init_box_pooler(roi_input_shape)
      self.box_pooler = box_pooler
  
      # Build heads.
      rcnn_head = RCNNHead(
          head_hidden_dim,
          num_classes,
          head_dim_feedforward,
          nhead,
          head_dropout,
          head_cls,
          head_reg,
          head_dim_dynamic,
          head_num_dynamic,
      )
      self.head_series = nn.LayerList(
          [copy.deepcopy(rcnn_head) for i in range(head_num_heads)]
      )
      self.return_intermediate = deep_supervision
  
      self.num_classes = num_classes
  
      # build init proposal
      self.init_proposal_features = nn.Embedding(
          num_proposals, head_hidden_dim
      )
      self.init_proposal_boxes = nn.Embedding(num_proposals, 4)
  
      self.lossfunc = loss_func
  
      # Init parameters.
      init.reset_initialized_parameter(self)
      self._reset_parameters()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import copy
  import paddle
  import paddle.nn
  from ppdet.core.workspace import register
  from ppdet.modeling.heads.roi_extractor import RoIAlign
  from ppdet.modeling.bbox_utils import delta2bbox
  from ..None import initializer
label_desc: Use image node_id 1 to create a new SparseRCNNHead object from inherited base classes: nn with example: obj = SparseRCNNHead(head_hidden_dim, head_dim_feedforward, nhead, head_dropout, head_cls, head_reg, head_dim_dynamic, head_num_dynamic, head_num_heads, deep_supervision, num_proposals, num_classes, loss_func, roi_input_shape)