class_docstr: The EMANet head.
  
  Args:
      num_classes (int): The unique number of target classes.
      in_channels (tuple): The number of input channels.
      ema_channels (int): EMA module channels.
      gc_channels (int): The input channels to Global Context Block.
      num_bases (int): Number of bases.
      stage_num (int): The iteration number for EM.
      momentum (float): The parameter for updating bases.
      concat_input (bool): Whether concat the input and output of convs before classification layer. Default: True
      enable_auxiliary_loss (bool, optional): A bool value indicates whether adding auxiliary loss. Default: True.
class_docstr_tok: ["The","EMANet","head",".","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","in_channels","(","tuple",")",":","The","number","of","input","channels",".","ema_channels","(","int",")",":","EMA","module","channels",".","gc_channels","(","int",")",":","The","input","channels","to","Global","Context","Block",".","num_bases","(","int",")",":","Number","of","bases",".","stage_num","(","int",")",":","The","iteration","number","for","EM",".","momentum","(","float",")",":","The","parameter","for","updating","bases",".","concat_input","(","bool",")",":","Whether","concat","the","input","and","output","of","convs","before","classification","layer",".","Default",":","True","enable_auxiliary_loss","(","bool",",","optional",")",":","A","bool","value","indicates","whether","adding","auxiliary","loss",".","Default",":","True","."]
code: def __init__(
      self,
      num_classes,
      in_channels,
      ema_channels,
      gc_channels,
      num_bases,
      stage_num,
      momentum,
      concat_input=True,
      enable_auxiliary_loss=True,
  ):
      super(EMAHead, self).__init__()
  
      self.in_channels = in_channels[-1]
      self.concat_input = concat_input
      self.enable_auxiliary_loss = enable_auxiliary_loss
  
      self.emau = EMAU(
          ema_channels, num_bases, stage_num, momentum=momentum
      )
      self.ema_in_conv = layers.ConvBNReLU(
          in_channels=self.in_channels,
          out_channels=ema_channels,
          kernel_size=3,
      )
      self.ema_mid_conv = nn.Conv2D(
          ema_channels, ema_channels, kernel_size=1
      )
      self.ema_out_conv = layers.ConvBNReLU(
          in_channels=ema_channels,
          out_channels=ema_channels,
          kernel_size=1,
      )
      self.bottleneck = layers.ConvBNReLU(
          in_channels=ema_channels,
          out_channels=gc_channels,
          kernel_size=3,
      )
      self.cls = nn.Sequential(
          nn.Dropout2D(p=0.1), nn.Conv2D(gc_channels, num_classes, 1)
      )
      self.aux = nn.Sequential(
          layers.ConvBNReLU(
              in_channels=1024, out_channels=256, kernel_size=3
          ),
          nn.Dropout2D(p=0.1),
          nn.Conv2D(256, num_classes, 1),
      )
      if self.concat_input:
          self.conv_cat = layers.ConvBNReLU(
              self.in_channels + gc_channels, gc_channels, kernel_size=3
          )
  
file_path: PaddleSeg/paddleseg/models/emanet.py
imports: 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 EMAHead object from inherited base classes: nn with example: obj = EMAHead(num_classes, in_channels, ema_channels, gc_channels, num_bases, stage_num, momentum, concat_input, enable_auxiliary_loss)