class_docstr: Guided-Anchor-based RetinaNet head.
class_docstr_tok: ["Guided-Anchor-based","RetinaNet","head","."]
docstr: Initialize layers of the head.
docstr_tok: ["Initialize","layers","of","the","head","."]
code: def _init_layers(self) -> None:
      """Initialize layers of the head."""
      self.relu = nn.ReLU(inplace=True)
      self.cls_convs = nn.ModuleList()
      self.reg_convs = nn.ModuleList()
      for i in range(self.stacked_convs):
          chn = self.in_channels if i == 0 else self.feat_channels
          self.cls_convs.append(
              ConvModule(
                  chn,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
              )
          )
          self.reg_convs.append(
              ConvModule(
                  chn,
                  self.feat_channels,
                  3,
                  stride=1,
                  padding=1,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
              )
          )
  
      self.conv_loc = nn.Conv2d(self.feat_channels, 1, 1)
      num_anchors = self.square_anchor_generator.num_base_priors[0]
      self.conv_shape = nn.Conv2d(
          self.feat_channels, num_anchors * 2, 1
      )
      self.feature_adaption_cls = FeatureAdaption(
          self.feat_channels,
          self.feat_channels,
          kernel_size=3,
          deform_groups=self.deform_groups,
      )
      self.feature_adaption_reg = FeatureAdaption(
          self.feat_channels,
          self.feat_channels,
          kernel_size=3,
          deform_groups=self.deform_groups,
      )
      self.retina_cls = MaskedConv2d(
          self.feat_channels,
          self.num_base_priors * self.cls_out_channels,
          3,
          padding=1,
      )
      self.retina_reg = MaskedConv2d(
          self.feat_channels, self.num_base_priors * 4, 3, padding=1
      )
  
file_path: mmdetection/mmdet/models/dense_heads/ga_retina_head.py
imports: from typing import Tuple
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmcv.ops import MaskedConv2d
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import OptConfigType, OptMultiConfig
  from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead
label_desc: Use image node_id 2 for calling the GARetinaHead obj's underlying member method code with example usage: obj._init_layers() without return types