class_docstr: Simple Feature Pyramid Network for ViTDet.
code: def __init__(
      self,
      backbone_channel: int,
      in_channels: List[int],
      out_channels: int,
      num_outs: int,
      conv_cfg: OptConfigType = None,
      norm_cfg: OptConfigType = None,
      act_cfg: OptConfigType = None,
      init_cfg: MultiConfig = None,
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      assert isinstance(in_channels, list)
      self.backbone_channel = backbone_channel
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.num_ins = len(in_channels)
      self.num_outs = num_outs
  
      self.fpn1 = nn.Sequential(
          nn.ConvTranspose2d(
              self.backbone_channel, self.backbone_channel // 2, 2, 2
          ),
          build_norm_layer(norm_cfg, self.backbone_channel // 2)[1],
          nn.GELU(),
          nn.ConvTranspose2d(
              self.backbone_channel // 2,
              self.backbone_channel // 4,
              2,
              2,
          ),
      )
      self.fpn2 = nn.Sequential(
          nn.ConvTranspose2d(
              self.backbone_channel, self.backbone_channel // 2, 2, 2
          )
      )
      self.fpn3 = nn.Sequential(nn.Identity())
      self.fpn4 = nn.Sequential(nn.MaxPool2d(kernel_size=2, stride=2))
  
      self.lateral_convs = nn.ModuleList()
      self.fpn_convs = nn.ModuleList()
  
      for i in range(self.num_ins):
          l_conv = ConvModule(
              in_channels[i],
              out_channels,
              1,
              conv_cfg=conv_cfg,
              norm_cfg=norm_cfg,
              act_cfg=act_cfg,
              inplace=False,
          )
          fpn_conv = ConvModule(
              out_channels,
              out_channels,
              3,
              padding=1,
              conv_cfg=conv_cfg,
              norm_cfg=norm_cfg,
              act_cfg=act_cfg,
              inplace=False,
          )
  
          self.lateral_convs.append(l_conv)
          self.fpn_convs.append(fpn_conv)
  
file_path: mmdetection/projects/ViTDet/vitdet/simple_fpn.py
imports: from typing import List
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, build_norm_layer
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import MultiConfig, OptConfigType
label_desc: Use image node_id 1 to create a new SimpleFPN object from inherited base classes: BaseModule with example: obj = SimpleFPN(backbone_channel, in_channels, out_channels, num_outs, conv_cfg, norm_cfg, act_cfg, init_cfg)