class_docstr: DilatedEncoder used in YOLOF
class_docstr_tok: ["DilatedEncoder","used","in","YOLOF"]
code: def __init__(
      self,
      in_channels=[2048],
      out_channels=[512],
      block_mid_channels=128,
      num_residual_blocks=4,
      block_dilations=[2, 4, 6, 8],
  ):
      super(DilatedEncoder, self).__init__()
      self.in_channels = in_channels
      self.out_channels = out_channels
      assert (
          len(self.in_channels) == 1
      ), "YOLOF only has one level feature."
      assert (
          len(self.out_channels) == 1
      ), "YOLOF only has one level feature."
  
      self.block_mid_channels = block_mid_channels
      self.num_residual_blocks = num_residual_blocks
      self.block_dilations = block_dilations
  
      out_ch = self.out_channels[0]
      self.lateral_conv = nn.Conv2D(
          self.in_channels[0],
          out_ch,
          1,
          weight_attr=ParamAttr(
              initializer=KaimingUniform(
                  negative_slope=1, nonlinearity="leaky_relu"
              )
          ),
          bias_attr=ParamAttr(initializer=Constant(value=0.0)),
      )
      self.lateral_norm = nn.BatchNorm2D(
          out_ch,
          weight_attr=ParamAttr(regularizer=L2Decay(0.0)),
          bias_attr=ParamAttr(regularizer=L2Decay(0.0)),
      )
  
      self.fpn_conv = nn.Conv2D(
          out_ch,
          out_ch,
          3,
          padding=1,
          weight_attr=ParamAttr(
              initializer=KaimingUniform(
                  negative_slope=1, nonlinearity="leaky_relu"
              )
          ),
      )
      self.fpn_norm = nn.BatchNorm2D(
          out_ch,
          weight_attr=ParamAttr(regularizer=L2Decay(0.0)),
          bias_attr=ParamAttr(regularizer=L2Decay(0.0)),
      )
  
      encoder_blocks = []
      for i in range(self.num_residual_blocks):
          encoder_blocks.append(
              Bottleneck(
                  out_ch,
                  self.block_mid_channels,
                  dilation=block_dilations[i],
              )
          )
      self.dilated_encoder_blocks = nn.Sequential(*encoder_blocks)
  
file_path: PaddleDetection/ppdet/modeling/necks/dilated_encoder.py
imports: import paddle
  import paddle.nn
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import KaimingUniform, Constant, Normal
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new DilatedEncoder object from inherited base classes: nn with example: obj = DilatedEncoder(in_channels, out_channels, block_mid_channels, num_residual_blocks, block_dilations)