class_docstr: A regression and classification head for use in RetinaNet.
  
  Args:
      in_channels (int): number of channels of the input feature
      num_anchors (int): number of anchors to be predicted
      num_classes (int): number of classes to be predicted
class_docstr_tok: ["A","regression","and","classification","head","for","use","in","RetinaNet",".","Args",":","in_channels","(","int",")",":","number","of","channels","of","the","input","feature","num_anchors","(","int",")",":","number","of","anchors","to","be","predicted","num_classes","(","int",")",":","number","of","classes","to","be","predicted"]
code: def compute_loss(
      self,
      targets: List[Dict[str, Tensor]],
      head_outputs: Dict[str, Tensor],
      anchors: List[Tensor],
      matched_idxs: List[Tensor],
  ) -> Dict[str, Tensor]:
      return {
          "classification": self.classification_head.compute_loss(
              targets, head_outputs, matched_idxs
          ),
          "bbox_regression": self.regression_head.compute_loss(
              targets, head_outputs, anchors, matched_idxs
          ),
      }
  
imports: import math
  import warnings
  from collections import OrderedDict
  from typing import Dict, List, Tuple, Optional, Union
  import torch
  from torch import nn, Tensor
  from .None import det_utils
  from .anchor_utils import AnchorsGenerator
  from .None import boxes
  from .losses import sigmoid_focal_loss
  from .transform import GeneralizedRCNNTransform
label_desc: Use image node_id 2 for calling the RetinaNetHead obj's underlying member method code with example usage: obj.compute_loss(targets, head_outputs, anchors, matched_idxs) and returns: dict