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 get_loss(self, outputs, targets):
      losses = self.lossfunc(outputs, targets)
      weight_dict = self.lossfunc.weight_dict
  
      for k in losses.keys():
          if k in weight_dict:
              losses[k] *= weight_dict[k]
  
      return losses
  
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 5 for calling the SparseRCNNHead obj's underlying member method code with example usage: obj.get_loss(outputs, targets) and returns: losses