class_docstr: Description
  -----------
  Generalized Message Aggregator was introduced in "DeeperGCN: All You Need to Train Deeper GCNs <https://arxiv.org/abs/2006.07739>"
  
  Parameters
  ----------
  in_dim: int
      Input size.
  out_dim: int
      Output size.
  aggregator: str
      Type of aggregation. Default is 'softmax'.
  beta: float
      A continuous variable called an inverse temperature. Default is 1.0.
  learn_beta: bool
      Whether beta is a learnable variable or not. Default is False.
  p: float
      Initial power for power mean aggregation. Default is 1.0.
  learn_p: bool
      Whether p is a learnable variable or not. Default is False.
  msg_norm: bool
      Whether message normalization is used. Default is False.
  learn_msg_scale: bool
      Whether s is a learnable scaling factor or not in message normalization. Default is False.
  mlp_layers: int
      The number of MLP layers. Default is 1.
  eps: float
      A small positive constant in message construction function. Default is 1e-7.
class_docstr_tok: ["Description","--","--","--","--","--","-","Generalized","Message","Aggregator","was","introduced","in","``","DeeperGCN",":","All","You","Need","to","Train","Deeper","GCNs","<","https",":","\/\/arxiv.org\/abs\/2006.07739",">","''","Parameters","--","--","--","--","--","in_dim",":","int","Input","size",".","out_dim",":","int","Output","size",".","aggregator",":","str","Type","of","aggregation",".","Default","is","'softmax","'",".","beta",":","float","A","continuous","variable","called","an","inverse","temperature",".","Default","is","1.0.","learn_beta",":","bool","Whether","beta","is","a","learnable","variable","or","not",".","Default","is","False",".","p",":","float","Initial","power","for","power","mean","aggregation",".","Default","is","1.0.","learn_p",":","bool","Whether","p","is","a","learnable","variable","or","not",".","Default","is","False",".","msg_norm",":","bool","Whether","message","normalization","is","used",".","Default","is","False",".","learn_msg_scale",":","bool","Whether","s","is","a","learnable","scaling","factor","or","not","in","message","normalization",".","Default","is","False",".","mlp_layers",":","int","The","number","of","MLP","layers",".","Default","is","1.","eps",":","float","A","small","positive","constant","in","message","construction","function",".","Default","is","1e-7","."]
code: def __init__(
      self,
      in_dim,
      out_dim,
      aggregator="softmax",
      beta=1.0,
      learn_beta=False,
      p=1.0,
      learn_p=False,
      msg_norm=False,
      learn_msg_scale=False,
      mlp_layers=1,
      eps=1e-7,
  ):
      super(GENConv, self).__init__()
  
      self.aggr = aggregator
      self.eps = eps
  
      channels = [in_dim]
      for _ in range(mlp_layers - 1):
          channels.append(in_dim * 2)
      channels.append(out_dim)
  
      self.mlp = MLP(channels)
      self.msg_norm = MessageNorm(learn_msg_scale) if msg_norm else None
  
      self.beta = (
          nn.Parameter(torch.Tensor([beta]), requires_grad=True)
          if learn_beta and self.aggr == "softmax"
          else beta
      )
      self.p = (
          nn.Parameter(torch.Tensor([p]), requires_grad=True)
          if learn_p
          else p
      )
  
      self.edge_encoder = BondEncoder(in_dim)
  
file_path: dgl/examples/pytorch/deepergcn/layers.py
imports: import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.functional import edge_softmax
  from modules import MessageNorm, MLP
  from ogb.graphproppred.mol_encoder import BondEncoder
label_desc: Use image node_id 1 to create a new GENConv object from inherited base classes: nn with example: obj = GENConv(in_dim, out_dim, aggregator, beta, learn_beta, p, learn_p, msg_norm, learn_msg_scale, mlp_layers, eps)