code: def main(args):
      dataset = load()
  
      graph = dataset.graph
      train_index = dataset.train_index
      train_label = dataset.train_label
  
      val_index = dataset.val_index
      val_label = dataset.val_label
      # We will use test dataset to deploy and infer.
  
      criterion = nn.loss.CrossEntropyLoss()
  
      if args.model == "GAT":
          gnn_model = GAT(
              input_size=graph.node_feat["words"].shape[1],
              num_class=dataset.num_classes,
              num_layers=2,
              feat_drop=0.6,
              attn_drop=0.6,
              num_heads=8,
              hidden_size=8,
          )
      elif args.model == "GCN":
          gnn_model = GCN(
              input_size=graph.node_feat["words"].shape[1],
              num_class=dataset.num_classes,
              num_layers=1,
              dropout=0.5,
              hidden_size=16,
          )
      elif args.model == "GraphSage":
          gnn_model = GraphSage(
              input_size=graph.node_feat["words"].shape[1],
              num_class=dataset.num_classes,
              num_layers=2,
              hidden_size=16,
          )
      else:
          raise ValueError("%s model is supported!" % args.model)
  
      optim = Adam(
          learning_rate=0.005,
          parameters=gnn_model.parameters(),
          weight_decay=0.0005,
      )
  
      best_val_acc = 0
      for epoch in range(args.epoch):
          train_loss, train_acc = train(
              train_index,
              train_label,
              gnn_model,
              graph,
              criterion,
              optim,
              args,
          )
          val_loss, val_acc = eval(
              val_index, val_label, gnn_model, graph, criterion, args
          )
          if val_acc > best_val_acc:
              paddle.save(
                  gnn_model.state_dict(),
                  "%s.pdparam" % args.model.lower(),
              )
              best_val_acc = val_acc
  
      log.info(
          "Model: %s, Best Val Accuracy: %f"
          % (args.model, best_val_acc)
      )
  
file_path: PGL/examples/gnn_depoly/node_classification_with_full_graph/train.py
imports: import os
  import sys
  import argparse
  import numpy
  import paddle
  import pgl
  import paddle.nn
  from pgl.utils.logger import log
  from paddle.optimizer import Adam
  from models import GCN, GAT, GraphSage
label_desc: Use image node_id 5 for calling a global function with example usage: main(args) without return types