class_docstr: An anchor-based head used in `RetinaNet
  <https://arxiv.org/pdf/1708.02002.pdf>`_.
  
  The head contains two subnetworks. The first classifies anchor boxes and
  the second regresses deltas for the anchors.
  
  Example:
      >>> import torch
      >>> self = RetinaHead(11, 7)
      >>> x = torch.rand(1, 7, 32, 32)
      >>> cls_score, bbox_pred = self.forward_single(x)
      >>> # Each anchor predicts a score for each class except background
      >>> cls_per_anchor = cls_score.shape[1] / self.num_anchors
      >>> box_per_anchor = bbox_pred.shape[1] / self.num_anchors
      >>> assert cls_per_anchor == (self.num_classes)
      >>> assert box_per_anchor == 4
docstr: Initialize layers of the head.
code: def _init_layers(self):
      """Initialize layers of the head."""
      self.relu = nn.ReLU(inplace=True)
      self.cls_convs = nn.ModuleList()
      self.reg_convs = nn.ModuleList()
      in_channels = self.in_channels
      for i in range(self.stacked_convs):
          self.cls_convs.append(
              ConvModule(
                  in_channels,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
              )
          )
          self.reg_convs.append(
              ConvModule(
                  in_channels,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
              )
          )
          in_channels = self.feat_channels
      self.retina_cls = nn.Conv2d(
          in_channels,
          self.num_base_priors * self.cls_out_channels,
          3,
          padding=1,
      )
      reg_dim = self.bbox_coder.encode_size
      self.retina_reg = nn.Conv2d(
          in_channels, self.num_base_priors * reg_dim, 3, padding=1
      )
  
file_path: mmdetection/mmdet/models/dense_heads/retina_head.py
imports: import torch.nn
  from mmcv.cnn import ConvModule
  from mmdet.registry import MODELS
  from .anchor_head import AnchorHead
label_desc: Use image node_id 2 for calling the RetinaHead obj's underlying member method code with example usage: obj._init_layers() without return types