class_docstr: RCNN bbox head
  
  Args:
      head (object): the head module instance, e.g., `ResNetC5`, `TwoFCHead`
      box_coder (object): `BoxCoder` instance
      nms (object): `MultiClassNMS` instance
      num_classes: number of output classes
docstr: Get bbox_head loss.
  
  Args:
      roi_feat (Variable): RoI feature from RoIExtractor.
      labels_int32(Variable): Class label of a RoI with shape [P, 1].
          P is the number of RoI.
      bbox_targets(Variable): Box label of a RoI with shape
          [P, 4 * class_nums].
      bbox_inside_weights(Variable): Indicates whether a box should
          contribute to loss. Same shape as bbox_targets.
      bbox_outside_weights(Variable): Indicates whether a box should
          contribute to loss. Same shape as bbox_targets.
  
  Return:
      Type: Dict
          loss_cls(Variable): bbox_head loss.
          loss_bbox(Variable): bbox_head loss.
docstr_tok: ["Get","bbox_head","loss",".","Args",":","roi_feat","(","Variable",")",":","RoI","feature","from","RoIExtractor",".","labels_int32","(","Variable",")",":","Class","label","of","a","RoI","with","shape","[","P",",","1","]",".","P","is","the","number","of","RoI",".","bbox_targets","(","Variable",")",":","Box","label","of","a","RoI","with","shape","[","P",",","4","*","class_nums","]",".","bbox_inside_weights","(","Variable",")",":","Indicates","whether","a","box","should","contribute","to","loss",".","Same","shape","as","bbox_targets",".","bbox_outside_weights","(","Variable",")",":","Indicates","whether","a","box","should","contribute","to","loss",".","Same","shape","as","bbox_targets",".","Return",":","Type",":","Dict","loss_cls","(","Variable",")",":","bbox_head","loss",".","loss_bbox","(","Variable",")",":","bbox_head","loss","."]
code: def get_loss(
      self,
      roi_feat,
      labels_int32,
      bbox_targets,
      bbox_inside_weights,
      bbox_outside_weights,
  ):
      """
      Get bbox_head loss.
  
      Args:
          roi_feat (Variable): RoI feature from RoIExtractor.
          labels_int32(Variable): Class label of a RoI with shape [P, 1].
              P is the number of RoI.
          bbox_targets(Variable): Box label of a RoI with shape
              [P, 4 * class_nums].
          bbox_inside_weights(Variable): Indicates whether a box should
              contribute to loss. Same shape as bbox_targets.
          bbox_outside_weights(Variable): Indicates whether a box should
              contribute to loss. Same shape as bbox_targets.
  
      Return:
          Type: Dict
              loss_cls(Variable): bbox_head loss.
              loss_bbox(Variable): bbox_head loss.
      """
  
      cls_score, bbox_pred = self._get_output(roi_feat)
  
      labels_int64 = fluid.layers.cast(x=labels_int32, dtype="int64")
      labels_int64.stop_gradient = True
      loss_cls = fluid.layers.softmax_with_cross_entropy(
          logits=cls_score, label=labels_int64, numeric_stable_mode=True
      )
      loss_cls = fluid.layers.reduce_mean(loss_cls)
      loss_bbox = self.bbox_loss(
          x=bbox_pred,
          y=bbox_targets,
          inside_weight=bbox_inside_weights,
          outside_weight=bbox_outside_weights,
      )
      loss_bbox = fluid.layers.reduce_mean(loss_bbox)
      return {"loss_cls": loss_cls, "loss_bbox": loss_bbox}
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import OrderedDict
  from paddle import fluid
  from paddle.fluid.param_attr import ParamAttr
  from paddle.fluid.initializer import Normal, Xavier
  from paddle.fluid.regularizer import L2Decay
  from paddle.fluid.initializer import MSRA
label_desc: Use image node_id 4 for calling the BBoxHead obj's underlying member method code with example usage: obj.get_loss(roi_feat, labels_int32, bbox_targets, bbox_inside_weights, bbox_outside_weights) and returns: dict