class_docstr: This class computes the loss for SparseRCNN.
  The process happens in two steps:
      1) we compute hungarian assignment between ground truth boxes and the outputs of the model
      2) we supervise each pair of matched ground-truth / prediction (supervise class and box)
class_docstr_tok: ["This","class","computes","the","loss","for","SparseRCNN",".","The","process","happens","in","two","steps",":","1",")","we","compute","hungarian","assignment","between","ground","truth","boxes","and","the","outputs","of","the","model","2",")","we","supervise","each","pair","of","matched","ground-truth","\/","prediction","(","supervise","class","and","box",")"]
docstr: Create the criterion.
  Parameters:
      num_classes: number of object categories, omitting the special no-object category
      weight_dict: dict containing as key the names of the losses and as values their relative weight.
      losses: list of all the losses to be applied. See get_loss for list of available losses.
      matcher: module able to compute a matching between targets and proposals
docstr_tok: ["Create","the","criterion",".","Parameters",":","num_classes",":","number","of","object","categories",",","omitting","the","special","no-object","category","weight_dict",":","dict","containing","as","key","the","names","of","the","losses","and","as","values","their","relative","weight",".","losses",":","list","of","all","the","losses","to","be","applied",".","See","get_loss","for","list","of","available","losses",".","matcher",":","module","able","to","compute","a","matching","between","targets","and","proposals"]
code: def __init__(
      self,
      losses,
      focal_loss_alpha,
      focal_loss_gamma,
      num_classes=80,
      class_weight=2.0,
      l1_weight=5.0,
      giou_weight=2.0,
  ):
      """Create the criterion.
      Parameters:
          num_classes: number of object categories, omitting the special no-object category
          weight_dict: dict containing as key the names of the losses and as values their relative weight.
          losses: list of all the losses to be applied. See get_loss for list of available losses.
          matcher: module able to compute a matching between targets and proposals
      """
      super().__init__()
      self.num_classes = num_classes
      weight_dict = {
          "loss_ce": class_weight,
          "loss_bbox": l1_weight,
          "loss_giou": giou_weight,
      }
      self.weight_dict = weight_dict
      self.losses = losses
      self.giou_loss = GIoULoss(reduction="sum")
  
      self.focal_loss_alpha = focal_loss_alpha
      self.focal_loss_gamma = focal_loss_gamma
  
      self.matcher = HungarianMatcher(
          focal_loss_alpha,
          focal_loss_gamma,
          class_weight,
          l1_weight,
          giou_weight,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from scipy.optimize import linear_sum_assignment
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.metric import accuracy
  from ppdet.core.workspace import register
  from ppdet.modeling.losses.iou_loss import GIoULoss
label_desc: Use image node_id 1 to create a new SparseRCNNLoss object from inherited base classes: nn with example: obj = SparseRCNNLoss(losses, focal_loss_alpha, focal_loss_gamma, num_classes, class_weight, l1_weight, giou_weight)