class_docstr: num_stages: int, bifpn number of repeats
  in_channels: List[int], input dim for P3, P4, P5
  out_channels: int, output dim for P2 - P7
  start_level: int, Index of input features in backbone
  epsilon: float, hyperparameter in fusion features
  apply_bn_for_resampling: bool, whether use bn after resampling
  conv_bn_act_pattern: bool, whether use conv_bn_act_pattern
  norm_cfg: (:obj:`ConfigDict` or dict, optional): Config dict for
      normalization layer.
  init_cfg: MultiConfig: init method
class_docstr_tok: ["num_stages",":","int",",","bifpn","number","of","repeats","in_channels",":","List","[","int","]",",","input","dim","for","P3",",","P4",",","P5","out_channels",":","int",",","output","dim","for","P2","-","P7","start_level",":","int",",","Index","of","input","features","in","backbone","epsilon",":","float",",","hyperparameter","in","fusion","features","apply_bn_for_resampling",":","bool",",","whether","use","bn","after","resampling","conv_bn_act_pattern",":","bool",",","whether","use","conv_bn_act_pattern","norm_cfg",":","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","dict","for","normalization","layer",".","init_cfg",":","MultiConfig",":","init","method"]
code: def __init__(
      self,
      num_stages: int,
      in_channels: List[int],
      out_channels: int,
      start_level: int = 0,
      epsilon: float = 1e-4,
      apply_bn_for_resampling: bool = True,
      conv_bn_act_pattern: bool = False,
      norm_cfg: OptConfigType = dict(
          type="BN", momentum=1e-2, eps=1e-3
      ),
      init_cfg: MultiConfig = None,
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      self.start_level = start_level
      self.bifpn = nn.Sequential(
          *[
              BiFPNStage(
                  in_channels=in_channels,
                  out_channels=out_channels,
                  first_time=True if _ == 0 else False,
                  apply_bn_for_resampling=apply_bn_for_resampling,
                  conv_bn_act_pattern=conv_bn_act_pattern,
                  norm_cfg=norm_cfg,
                  epsilon=epsilon,
              )
              for _ in range(num_stages)
          ]
      )
  
file_path: mmdetection/projects/EfficientDet/efficientdet/bifpn.py
imports: from typing import List
  import torch
  import torch.nn
  from mmcv.cnn.bricks import Swish
  from mmengine.model import BaseModule
  from mmdet.registry import MODELS
  from mmdet.utils import MultiConfig, OptConfigType
  from .utils import DepthWiseConvBlock, DownChannelBlock, MaxPool2dSamePadding
label_desc: Use image node_id 1 to create a new BiFPN object from inherited base classes: BaseModule with example: obj = BiFPN(num_stages, in_channels, out_channels, start_level, epsilon, apply_bn_for_resampling, conv_bn_act_pattern, norm_cfg, init_cfg)