class_docstr: Implement of GAT
      
class_docstr_tok: ["Implement","of","GAT"]
code: def __init__(
      self,
      input_size,
      num_class,
      num_layers=1,
      feat_drop=0.6,
      attn_drop=0.6,
      num_heads=8,
      hidden_size=8,
      drop=0.1,
      edge_type=5,
      activation=None,
      alpha=None,
      **kwargs,
  ):
      super(GNNModel, self).__init__()
      self.num_class = num_class
      self.num_layers = num_layers
      self.feat_drop = feat_drop
      self.attn_drop = attn_drop
      self.num_heads = num_heads
      self.hidden_size = hidden_size
      self.drop = drop
      self.edge_type = edge_type
      self.gats = nn.LayerList()
      self.skips = nn.LayerList()
      self.norms = nn.LayerList()
      self.path_attns = nn.LayerList()
      self.path_norms = nn.LayerList()
      self.label_embed = nn.Embedding(num_class, input_size)
      self.gpr_attn = None
      if alpha:
          k_hop = num_layers
          self.gpr_attn = alpha * (1 - alpha) ** np.arange(k_hop + 1)
          self.gpr_attn[-1] = (1 - alpha) ** k_hop
      # whether to use learnable year_pos
      if "m2v_dim" in kwargs:
          self.m2v_dim = kwargs["m2v_dim"]
      else:
          self.m2v_dim = 64
      self.m2v_fc = linear_init(
          self.m2v_dim, input_size, init_type="linear"
      )
      # self.p2p_fc = linear_init(self.m2v_dim, input_size, init_type='linear')
      fc_w_attr = paddle.ParamAttr(
          initializer=nn.initializer.Constant(1.0)
      )
      fc_bias_attr = paddle.ParamAttr(
          initializer=nn.initializer.Constant(0.0)
      )
      for i in range(self.num_layers):
          self.path_attns.append(
              linear_init(self.hidden_size, 1, init_type="linear")
          )
          self.path_norms.append(
              nn.BatchNorm1D(
                  self.hidden_size,
                  momentum=0.9,
                  weight_attr=fc_w_attr,
                  bias_attr=fc_bias_attr,
                  data_format="NC",
              )
          )
          self.norms.append(
              nn.LayerList(
                  [
                      nn.BatchNorm1D(
                          self.hidden_size,
                          momentum=0.9,
                          weight_attr=fc_w_attr,
                          bias_attr=fc_bias_attr,
                          data_format="NC",
                      )
                      for _ in range(edge_type + 1)
                  ]
              )
          )
          if i == 0:
              self.skips.append(
                  linear_init(
                      input_size, self.hidden_size, init_type="linear"
                  )
              )
              self.gats.append(
                  nn.LayerList(
                      [
                          GATConv(
                              input_size,
                              self.hidden_size // self.num_heads,
                              self.feat_drop,
                              self.attn_drop,
                              self.num_heads,
                              activation=None,
                          )
                          for _ in range(edge_type)
                      ]
                  )
              )
          else:
              self.skips.append(
                  linear_init(
                      self.hidden_size,
                      self.hidden_size,
                      init_type="linear",
                  )
              )
              self.gats.append(
                  nn.LayerList(
                      [
                          GATConv(
                              self.hidden_size,
                              self.hidden_size // self.num_heads,
                              self.feat_drop,
                              self.attn_drop,
                              self.num_heads,
                              activation=None,
                          )
                          for _ in range(edge_type)
                      ]
                  )
              )
  
      self.mlp = nn.Sequential(
          nn.Linear(self.hidden_size, self.hidden_size),
          nn.BatchNorm1D(
              self.hidden_size,
              momentum=0.9,
              weight_attr=fc_w_attr,
              bias_attr=fc_bias_attr,
              data_format="NC",
          ),
          nn.ReLU(),
          nn.Dropout(p=self.drop),
          nn.Linear(self.hidden_size, self.num_class),
      )
  
      self.label_mlp = nn.Sequential(
          nn.Linear(2 * input_size, self.hidden_size),
          nn.BatchNorm1D(
              self.hidden_size,
              momentum=0.9,
              weight_attr=fc_w_attr,
              bias_attr=fc_bias_attr,
              data_format="NC",
          ),
          nn.ReLU(),
          nn.Dropout(p=self.drop),
          nn.Linear(self.hidden_size, input_size),
      )
  
      self.dropout = nn.Dropout(p=self.drop)
      self.input_drop = nn.Dropout(p=0.3)
  
file_path: PGL/examples/NeurIPS2022-OGB-Challenge/MAG240M/models/r_unimp_peg_gpr_m2v.py
imports: import pgl
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from .gat_conv_peg import linear_init, GATConv
  import numpy
label_desc: Use image node_id 1 to create a new GNNModel object from inherited base classes: nn with example: obj = GNNModel(input_size, num_class, num_layers, feat_drop, attn_drop, num_heads, hidden_size, drop, edge_type, activation, alpha)