code: def main(args, config):
      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
      GraphModel = getattr(model, config.model_name)
      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 = GraphModel(
              input_size=graph.node_feat["words"].shape[1],
              num_class=dataset.num_classes,
              **config,
          )
  
          optim = Adam(
              learning_rate=config.learning_rate,
              parameters=gnn_model.parameters(),
              weight_decay=config.weight_decay,
          )
  
          for epoch in tqdm.tqdm(range(args.epoch)):
              train_loss, train_acc = train(
                  train_index,
                  train_label,
                  gnn_model,
                  graph,
                  criterion,
                  optim,
              )
              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,
                  config.model_name,
                  cal_test_acc[np.argmin(cal_val_loss)],
              )
          )
  
          best_test.append(cal_test_acc[np.argmin(cal_val_loss)])
  
      log.info(
          "Dataset: %s Best Test Accuracy: %f ( stddev: %f )"
          % (args.dataset, np.mean(best_test), np.std(best_test))
      )
  
file_path: PGL/examples/citation_benchmark/train.py
imports: import pgl
  import model
  import paddle
  import paddle.nn
  from pgl.utils.logger import log
  import numpy
  import time
  import argparse
  import yaml
  from easydict import EasyDict
  import tqdm
  from paddle.optimizer import Adam
label_desc: Use image node_id 6 for calling a global function with example usage: main(args, config) without return types