class_docstr: Implementation of TransformerConv from UniMP
  This is an implementation of the paper Unified Message Passing Model for Semi-Supervised Classification
  (https://arxiv.org/abs/2009.03509).
  Args:
  
      input_size: The size of the inputs. 
  
      hidden_size: The hidden size for gat.
  
      activation: (default None) The activation for the output.
  
      num_heads: (default 4) The head number in transformerconv.
  
      feat_drop: (default 0.6) Dropout rate for feature.
  
      attn_drop: (default 0.6) Dropout rate for attention.
  
      concat: (default True) Whether to concat output heads or average them.
      skip_feat: (default True) Whether to add a skip conect from input to output.
      gate: (default False) Whether to use a gate function in skip conect.
      layer_norm: (default True) Whether to aply layer norm in output
class_docstr_tok: ["Implementation","of","TransformerConv","from","UniMP","This","is","an","implementation","of","the","paper","Unified","Message","Passing","Model","for","Semi-Supervised","Classification","(","https",":","\/\/arxiv.org\/abs\/2009.03509",")",".","Args",":","input_size",":","The","size","of","the","inputs",".","hidden_size",":","The","hidden","size","for","gat",".","activation",":","(","default","None",")","The","activation","for","the","output",".","num_heads",":","(","default","4",")","The","head","number","in","transformerconv",".","feat_drop",":","(","default","0.6",")","Dropout","rate","for","feature",".","attn_drop",":","(","default","0.6",")","Dropout","rate","for","attention",".","concat",":","(","default","True",")","Whether","to","concat","output","heads","or","average","them",".","skip_feat",":","(","default","True",")","Whether","to","add","a","skip","conect","from","input","to","output",".","gate",":","(","default","False",")","Whether","to","use","a","gate","function","in","skip","conect",".","layer_norm",":","(","default","True",")","Whether","to","aply","layer","norm","in","output"]
code: def __init__(
      self,
      input_size,
      hidden_size,
      num_heads=4,
      feat_drop=0.6,
      attn_drop=0.6,
      concat=True,
      skip_feat=True,
      gate=False,
      layer_norm=True,
      activation="relu",
  ):
      super(TransformerConv, self).__init__()
  
      self.hidden_size = hidden_size
      self.num_heads = num_heads
      self.feat_drop = feat_drop
      self.attn_drop = attn_drop
      self.concat = concat
  
      self.q = linear_init(
          input_size, num_heads * hidden_size, init_type="gcn"
      )
      self.k = linear_init(
          input_size, num_heads * hidden_size, init_type="gcn"
      )
      self.v = linear_init(
          input_size, num_heads * hidden_size, init_type="gcn"
      )
  
      self.feat_dropout = nn.Dropout(p=feat_drop)
      self.attn_dropout = nn.Dropout(p=attn_drop)
  
      if skip_feat:
          if concat:
              self.skip_feat = linear_init(
                  input_size, num_heads * hidden_size, init_type="gcn"
              )
          else:
              self.skip_feat = linear_init(
                  input_size, hidden_size, init_type="gcn"
              )
      else:
          self.skip_feat = None
  
      if gate:
          if concat:
              self.gate = linear_init(
                  3 * num_heads * hidden_size, 1, init_type="gcn"
              )
          else:
              self.gate = linear_init(
                  3 * hidden_size, 1, init_type="gcn"
              )
      else:
          self.gate = None
  
      if layer_norm:
          if self.concat:
              self.layer_norm = nn.LayerNorm(num_heads * hidden_size)
          else:
              self.layer_norm = nn.LayerNorm(hidden_size)
      else:
          self.layer_norm = None
  
      if isinstance(activation, str):
          activation = getattr(F, activation)
      self.activation = activation
  
imports: import math
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import pgl
  from pgl.nn import functional
label_desc: Use image node_id 1 to create a new TransformerConv object from inherited base classes: nn with example: obj = TransformerConv(input_size, hidden_size, num_heads, feat_drop, attn_drop, concat, skip_feat, gate, layer_norm, activation)