code: def main(args):
      dataset = load(args.dataset, args.feature_pre_normalize)
  
      graph = dataset.graph
      train_index = dataset.train_index
      train_label = dataset.train_label
  
      val_index = dataset.val_index
      val_label = dataset.val_label
  
      test_index = dataset.test_index
      test_label = dataset.test_label
      criterion = paddle.nn.loss.CrossEntropyLoss()
  
      dur = []
  
      best_test = []
  
      for run in range(args.runs):
          cal_val_acc = []
          cal_test_acc = []
          cal_val_loss = []
          cal_test_loss = []
          gnn_model = FAGCN(
              input_size=graph.node_feat["words"].shape[1],
              hidden_size=16,
              output_size=dataset.num_classes,
              drop=0.6,
              eps=0.2,
              num_layer=5,
          )
  
          optim = Adam(
              learning_rate=0.005,
              parameters=gnn_model.parameters(),
              weight_decay=0.0005,
          )
  
          for epoch in tqdm.tqdm(range(args.epoch)):
              if epoch >= 3:
                  start = time.time()
              train_loss, train_acc = train(
                  train_index,
                  train_label,
                  gnn_model,
                  graph,
                  criterion,
                  optim,
              )
              if epoch >= 3:
                  end = time.time()
                  dur.append(end - start)
              val_loss, val_acc = eval(
                  val_index, val_label, gnn_model, graph, criterion
              )
              cal_val_acc.append(val_acc.numpy())
              cal_val_loss.append(val_loss.numpy())
  
              test_loss, test_acc = eval(
                  test_index, test_label, gnn_model, graph, criterion
              )
              cal_test_acc.append(test_acc.numpy())
              cal_test_loss.append(test_loss.numpy())
  
          log.info(
              "Runs %s: Model: %s Best Test Accuracy: %f"
              % (
                  run,
                  type(gnn_model).__name__,
                  cal_test_acc[np.argmin(cal_val_loss)],
              )
          )
  
          best_test.append(cal_test_acc[np.argmin(cal_val_loss)])
  
      log.info("Average Speed %s sec/ epoch" % (np.mean(dur)))
      log.info(
          "Dataset: %s Best Test Accuracy: %f ( stddev: %f )"
          % (args.dataset, np.mean(best_test), np.std(best_test))
      )
  
file_path: PGL/examples/fagcn/train.py
imports: import tqdm
  import pgl
  import paddle
  import paddle.nn
  from pgl.utils.logger import log
  import numpy
  import time
  import argparse
  from paddle.optimizer import Adam
label_desc: Use image node_id 6 for calling a global function with example usage: main(args) without return types