class_docstr: The PFPNHead implementation.
  
  Args:
      inplane (int): Input channels of PPM module.
      num_class (int): The unique number of target classes.
      fpn_inplanes (list): The feature channels from backbone.
      fpn_dim (int, optional): The input channels of FPN module. Default: 512.
      enable_auxiliary_loss (bool, optional): A bool value indicates whether adding auxiliary loss. Default: False.
class_docstr_tok: ["The","PFPNHead","implementation",".","Args",":","inplane","(","int",")",":","Input","channels","of","PPM","module",".","num_class","(","int",")",":","The","unique","number","of","target","classes",".","fpn_inplanes","(","list",")",":","The","feature","channels","from","backbone",".","fpn_dim","(","int",",","optional",")",":","The","input","channels","of","FPN","module",".","Default",":","512.","enable_auxiliary_loss","(","bool",",","optional",")",":","A","bool","value","indicates","whether","adding","auxiliary","loss",".","Default",":","False","."]
code: def __init__(
      self,
      num_class,
      fpn_inplanes,
      channels,
      dropout_ratio=0.1,
      fpn_dim=256,
      enable_auxiliary_loss=False,
      align_corners=False,
  ):
      super(PFPNHead, self).__init__()
      self.enable_auxiliary_loss = enable_auxiliary_loss
      self.align_corners = align_corners
      self.lateral_convs = nn.LayerList()
      self.fpn_out = nn.LayerList()
  
      for fpn_inplane in fpn_inplanes:
          self.lateral_convs.append(
              nn.Sequential(
                  nn.Conv2D(fpn_inplane, fpn_dim, 1),
                  layers.SyncBatchNorm(fpn_dim),
                  nn.ReLU(),
              )
          )
          self.fpn_out.append(
              nn.Sequential(
                  layers.ConvBNReLU(
                      fpn_dim, fpn_dim, 3, bias_attr=False
                  )
              )
          )
  
      self.scale_heads = nn.LayerList()
      for index in range(len(fpn_inplanes)):
          head_length = max(
              1,
              int(
                  np.log2(fpn_inplanes[index])
                  - np.log2(fpn_inplanes[0])
              ),
          )
          scale_head = nn.LayerList()
          for head_index in range(head_length):
              scale_head.append(
                  layers.ConvBNReLU(
                      fpn_dim,
                      channels,
                      3,
                      padding=1,
                  )
              )
              if fpn_inplanes[index] != fpn_inplanes[0]:
                  scale_head.append(
                      nn.Upsample(
                          scale_factor=2,
                          mode="bilinear",
                          align_corners=align_corners,
                      )
                  )
          self.scale_heads.append(nn.Sequential(*scale_head))
  
      if dropout_ratio:
          self.dropout = nn.Dropout2D(dropout_ratio)
          if self.enable_auxiliary_loss:
              self.dsn = nn.Sequential(
                  layers.ConvBNReLU(
                      fpn_inplanes[2], fpn_inplanes[2], 3, padding=1
                  ),
                  nn.Dropout2D(dropout_ratio),
                  nn.Conv2D(fpn_inplanes[2], num_class, kernel_size=1),
              )
      else:
          self.dropout = None
          if self.enable_auxiliary_loss:
              self.dsn = nn.Sequential(
                  layers.ConvBNReLU(
                      fpn_inplanes[2], fpn_inplanes[2], 3, padding=1
                  ),
                  nn.Conv2D(fpn_inplanes[2], num_class, kernel_size=1),
              )
  
      self.conv_last = nn.Sequential(
          layers.ConvBNReLU(
              len(fpn_inplanes) * fpn_dim, fpn_dim, 3, bias_attr=False
          ),
          nn.Conv2D(fpn_dim, num_class, kernel_size=1),
      )
      self.conv_seg = nn.Conv2D(channels, num_class, kernel_size=1)
  
file_path: PaddleSeg/paddleseg/models/pfpnnet.py
imports: import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new PFPNHead object from inherited base classes: nn with example: obj = PFPNHead(num_class, fpn_inplanes, channels, dropout_ratio, fpn_dim, enable_auxiliary_loss, align_corners)