class_docstr: A regression head for use in RetinaNet.
  
  This head takes a list of feature maps as inputs, and outputs a list of box regression maps.
  Each output box regression map has same spatial size with the corresponding input feature map,
  and the number of output channel is num_anchors * 2 * spatial_dims.
  
  Args:
      in_channels: number of channels of the input feature
      num_anchors: number of anchors to be predicted
      spatial_dims: spatial dimension of the network, should be 2 or 3.
class_docstr_tok: ["A","regression","head","for","use","in","RetinaNet",".","This","head","takes","a","list","of","feature","maps","as","inputs",",","and","outputs","a","list","of","box","regression","maps",".","Each","output","box","regression","map","has","same","spatial","size","with","the","corresponding","input","feature","map",",","and","the","number","of","output","channel","is","num_anchors","*","2","*","spatial_dims",".","Args",":","in_channels",":","number","of","channels","of","the","input","feature","num_anchors",":","number","of","anchors","to","be","predicted","spatial_dims",":","spatial","dimension","of","the","network",",","should","be","2","or","3","."]
code: def __init__(
      self, in_channels: int, num_anchors: int, spatial_dims: int
  ):
      super().__init__()
  
      conv_type: Callable = Conv[Conv.CONV, spatial_dims]
  
      conv = []
      for _ in range(4):
          conv.append(
              conv_type(
                  in_channels,
                  in_channels,
                  kernel_size=3,
                  stride=1,
                  padding=1,
              )
          )
          conv.append(
              nn.GroupNorm(num_groups=8, num_channels=in_channels)
          )
          conv.append(nn.ReLU())
  
      self.conv = nn.Sequential(*conv)
  
      self.bbox_reg = conv_type(
          in_channels,
          num_anchors * 2 * spatial_dims,
          kernel_size=3,
          stride=1,
          padding=1,
      )
      torch.nn.init.normal_(self.bbox_reg.weight, std=0.01)
      torch.nn.init.zeros_(self.bbox_reg.bias)
  
      for layer in self.conv.children():
          if isinstance(layer, conv_type):  # type: ignore
              torch.nn.init.normal_(layer.weight, std=0.01)
              torch.nn.init.zeros_(layer.bias)
  
imports: from __future__ import annotations
  import math
  import warnings
  from collections.abc import Callable, Sequence
  from typing import Any, Dict
  import torch
  from torch import Tensor, nn
  from monai.networks.blocks.backbone_fpn_utils import BackboneWithFPN, _resnet_fpn_extractor
  from monai.networks.layers.factories import Conv
  from monai.networks.nets import resnet
  from monai.utils import ensure_tuple_rep, look_up_option, optional_import
label_desc: Use image node_id 1 to create a new RetinaNetRegressionHead object from inherited base classes: nn with example: obj = RetinaNetRegressionHead(in_channels, num_anchors, spatial_dims)