class_docstr: Implementation of GIN model + Global Pool(mean, GMT, GlobalAttention, Set2Set).
      
class_docstr_tok: ["Implementation","of","GIN","model","+","Global","Pool","(","mean",",","GMT",",","GlobalAttention",",","Set2Set",")","."]
code: def __init__(self, args, num_class):
      super(GINModel, self).__init__()
      self.args = args
      self.num_layers = self.args.num_layers
      self.input_size = self.args.feat_size
      self.output_size = self.args.hidden_size
      self.init_eps = self.args.init_eps
      self.train_eps = self.args.train_eps
      self.pool_type = self.args.pool_type
      self.dropout_prob = self.args.dropout_prob
      self.use_residual = self.args.use_residual
      self.num_nodes = self.args.num_nodes
      self.num_class = num_class
      self.jk = self.args.jk
      self.gin_convs = nn.LayerList()
      self.norms = nn.LayerList()
      self.linears = nn.LayerList()
      self.final_dim = (
          self.output_size * 2
          if self.pool_type == "Set2Set"
          else self.output_size
      )
      self.out_layer = nn.Linear(self.final_dim, self.num_class)
      for i in range(self.num_layers):
          if i == 0:
              input_size = self.input_size
          else:
              input_size = self.output_size
          gin = pgl.nn.GINConv(
              input_size,
              self.output_size,
              "relu",
              self.init_eps,
              self.train_eps,
          )
          self.gin_convs.append(gin)
          ln = paddle.nn.BatchNorm1D(self.output_size)
          self.norms.append(ln)
  
      self.relu = nn.ReLU()
      if self.pool_type in ["sum", "mean", "max"]:
          self.graph_pooling = pgl.nn.GraphPool(self.pool_type)
      elif self.pool_type == "GlobalAttention":
          self.graph_pooling = GlobalAttention(
              nn.Linear(self.output_size, 1)
          )
      elif self.pool_type == "Set2Set":
          self.graph_pooling = Set2Set(self.output_size, n_iters=2)
      elif self.pool_type == "GMT":
          self.graph_pooling = GraphMultisetTransformer(
              self.output_size,
              self.output_size,
              self.output_size,
              num_nodes=self.num_nodes,
          )
      else:
          raise NotImplementedError
  
file_path: PGL/examples/global_pool/global_pool.py
imports: import os
  import sys
  import time
  import argparse
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import pgl
  from pgl.nn import GlobalAttention, Set2Set, GraphMultisetTransformer
label_desc: Use image node_id 1 to create a new GINModel object from inherited base classes: nn with example: obj = GINModel(args, num_class)