class_docstr: BiFPN decoder. Note this class does not compute additional feature maps (p6/p7) and expects them to be present in input.
  Because of this it supports arbitrary number of input feature maps.
  
  Reference: https://arxiv.org/abs/1911.09070
class_docstr_tok: ["BiFPN","decoder",".","Note","this","class","does","not","compute","additional","feature","maps","(","p6\/p7",")","and","expects","them","to","be","present","in","input",".","Because","of","this","it","supports","arbitrary","number","of","input","feature","maps",".","Reference",":","https",":","\/\/arxiv.org\/abs\/1911.09070"]
code: def __init__(
      self,
      input_spec: FeatureMapsSpecification,
      out_channels: int,
      num_layers: int,
      activation: str = ACT_RELU,
      normalization: str = NORM_BATCH,
      block: Union[
          Type[BiFPNConvBlock],
          Type[DepthwiseSeparableConv2dBlock],
          Callable[[int, int], nn.Module],
      ] = BiFPNConvBlock,
      projection_block: Callable[[int, int], nn.Module] = conv1x1,
  ):
      super().__init__(input_spec)
  
      self.projections = nn.ModuleList(
          [
              projection_block(in_channels, out_channels)
              for in_channels in input_spec.channels
          ]
      )
  
      bifpns = []
      for _ in range(num_layers):
          bifpns.append(
              BiFPNBlock(
                  out_channels,
                  num_feature_maps=len(input_spec),
                  activation=activation,
                  normalization=normalization,
                  block=block,
              )
          )
      self.bifpn = nn.Sequential(*bifpns)
  
      self.output_spec = FeatureMapsSpecification(
          channels=tuple([out_channels] * len(input_spec)),
          strides=input_spec.strides,
      )
  
imports: from typing import List, Tuple, Union, Type, Callable
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from pytorch_toolbelt.modules.activations import ACT_RELU, instantiate_activation_block
  from pytorch_toolbelt.modules.simple import conv1x1
  from pytorch_toolbelt.modules.dsconv import DepthwiseSeparableConv2dBlock
  from pytorch_toolbelt.modules.interfaces import AbstractDecoder, FeatureMapsSpecification
  from pytorch_toolbelt.modules.normalization import NORM_BATCH, instantiate_normalization_block
label_desc: Use image node_id 1 to create a new BiFPNDecoder object from inherited base classes: AbstractDecoder with example: obj = BiFPNDecoder(input_spec, out_channels, num_layers, activation, normalization, block, projection_block)