class_docstr: FreeAnchor RetinaHead used in https://arxiv.org/abs/1909.02466.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      stacked_convs (int): Number of conv layers in cls and reg tower.
          Defaults to 4.
      conv_cfg (:obj:`ConfigDict` or dict, optional): dictionary to
          construct and config conv layer. Defaults to None.
      norm_cfg (:obj:`ConfigDict` or dict, optional): dictionary to
          construct and config norm layer. Defaults to
          norm_cfg=dict(type='GN', num_groups=32, requires_grad=True).
      pre_anchor_topk (int): Number of boxes that be token in each bag.
          Defaults to 50
      bbox_thr (float): The threshold of the saturated linear function.
          It is usually the same with the IoU threshold used in NMS.
          Defaults to 0.6.
      gamma (float): Gamma parameter in focal loss. Defaults to 2.0.
      alpha (float): Alpha parameter in focal loss. Defaults to 0.5.
class_docstr_tok: ["FreeAnchor","RetinaHead","used","in","https",":","\/\/arxiv.org\/abs\/1909.02466",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","stacked_convs","(","int",")",":","Number","of","conv","layers","in","cls","and","reg","tower",".","Defaults","to","4.","conv_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","dictionary","to","construct","and","config","conv","layer",".","Defaults","to","None",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","dictionary","to","construct","and","config","norm","layer",".","Defaults","to","norm_cfg=dict","(","type='GN","'",",","num_groups=32",",","requires_grad=True",")",".","pre_anchor_topk","(","int",")",":","Number","of","boxes","that","be","token","in","each","bag",".","Defaults","to","50","bbox_thr","(","float",")",":","The","threshold","of","the","saturated","linear","function",".","It","is","usually","the","same","with","the","IoU","threshold","used","in","NMS",".","Defaults","to","0.6.","gamma","(","float",")",":","Gamma","parameter","in","focal","loss",".","Defaults","to","2.0.","alpha","(","float",")",":","Alpha","parameter","in","focal","loss",".","Defaults","to","0.5","."]
code: def __init__(
      self,
      num_classes: int,
      in_channels: int,
      stacked_convs: int = 4,
      conv_cfg: OptConfigType = None,
      norm_cfg: OptConfigType = None,
      pre_anchor_topk: int = 50,
      bbox_thr: float = 0.6,
      gamma: float = 2.0,
      alpha: float = 0.5,
      **kwargs,
  ) -> None:
      super().__init__(
          num_classes=num_classes,
          in_channels=in_channels,
          stacked_convs=stacked_convs,
          conv_cfg=conv_cfg,
          norm_cfg=norm_cfg,
          **kwargs,
      )
  
      self.pre_anchor_topk = pre_anchor_topk
      self.bbox_thr = bbox_thr
      self.gamma = gamma
      self.alpha = alpha
  
file_path: mmdetection/mmdet/models/dense_heads/free_anchor_retina_head.py
imports: from typing import List
  import torch
  import torch.nn.functional
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import bbox_overlaps
  from mmdet.utils import InstanceList, OptConfigType, OptInstanceList
  from ..utils import multi_apply
  from .retina_head import RetinaHead
label_desc: Use image node_id 1 to create a new FreeAnchorRetinaHead object from inherited base classes: RetinaHead with example: obj = FreeAnchorRetinaHead(num_classes, in_channels, stacked_convs, conv_cfg, norm_cfg, pre_anchor_topk, bbox_thr, gamma, alpha)