class_docstr: Two linear layers for predicting Fast R-CNN outputs:
  
  1. proposal-to-detection box regression deltas
  2. classification scores
class_docstr_tok: ["Two","linear","layers","for","predicting","Fast","R-CNN","outputs",":","1.","proposal-to-detection","box","regression","deltas","2.","classification","scores"]
docstr: Args:
      pred_class_logits: shape (N, K+1), scores for each of the N box. Each row contains the
      scores for K object categories and 1 background class
      gt_classes: a long tensor of shape R that contains the gt class label of each proposal.
docstr_tok: ["Args",":","pred_class_logits",":","shape","(","N",",","K+1",")",",","scores","for","each","of","the","N","box",".","Each","row","contains","the","scores","for","K","object","categories","and","1","background","class","gt_classes",":","a","long","tensor","of","shape","R","that","contains","the","gt","class","label","of","each","proposal","."]
code: def sigmoid_cross_entropy_loss(self, pred_class_logits, gt_classes):
      """
      Args:
          pred_class_logits: shape (N, K+1), scores for each of the N box. Each row contains the
          scores for K object categories and 1 background class
          gt_classes: a long tensor of shape R that contains the gt class label of each proposal.
      """
      if pred_class_logits.numel() == 0:
          return pred_class_logits.new_zeros([1])[0]
  
      N = pred_class_logits.shape[0]
      K = pred_class_logits.shape[1] - 1
  
      target = pred_class_logits.new_zeros(N, K + 1)
      target[range(len(gt_classes)), gt_classes] = 1
      target = target[:, :K]
  
      cls_loss = F.binary_cross_entropy_with_logits(
          pred_class_logits[:, :-1], target, reduction="none"
      )
  
      if self.use_fed_loss:
          fed_loss_classes = self.get_fed_loss_classes(
              gt_classes,
              num_fed_loss_classes=self.fed_loss_num_classes,
              num_classes=K,
              weight=self.fed_loss_cls_weights,
          )
          fed_loss_classes_mask = fed_loss_classes.new_zeros(K + 1)
          fed_loss_classes_mask[fed_loss_classes] = 1
          fed_loss_classes_mask = fed_loss_classes_mask[:K]
          weight = fed_loss_classes_mask.view(1, K).expand(N, K).float()
      else:
          weight = 1
  
      loss = torch.sum(cls_loss * weight) / N
      return loss
  
imports: import logging
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.data.detection_utils import get_fed_loss_cls_weights
  from detectron2.layers import ShapeSpec, batched_nms, cat, cross_entropy, nonzero_tuple
  from detectron2.modeling.box_regression import Box2BoxTransform, _dense_box_regression_loss
  from detectron2.structures import Boxes, Instances
  from detectron2.utils.events import get_event_storage
label_desc: Use image node_id 6 for calling the FastRCNNOutputLayers obj's underlying member method code with example usage: obj.sigmoid_cross_entropy_loss(pred_class_logits, gt_classes) and returns: loss, pred_class_logits