code: def focal_cost(cls_pred, gt_labels, alpha=0.25, gamma=2, eps=1e-12):
      """
      Args:
          cls_pred (Tensor): Predicted classification logits, shape
              [num_query, num_class].
          gt_labels (Tensor): Label of `gt_bboxes`, shape (num_gt,).
  
      Returns:
          torch.Tensor: cls_cost value
      """
      cls_pred = F.sigmoid(cls_pred)
      neg_cost = (
          -(1 - cls_pred + eps).log()
          * (1 - alpha)
          * cls_pred.pow(gamma)
      )
      pos_cost = (
          -(cls_pred + eps).log() * alpha * (1 - cls_pred).pow(gamma)
      )
      cls_cost = pos_cost.index_select(
          gt_labels, axis=1
      ) - neg_cost.index_select(gt_labels, axis=1)
      return cls_cost
  
imports: import paddle
  import paddle.nn.functional
  from ppdet.modeling.losses.clrnet_line_iou_loss import line_iou
label_desc: Use image node_id 2 for calling a global function with example usage: focal_cost(cls_pred, gt_labels, alpha, gamma, eps) and returns: cls_cost