code: def main(args):
      criterion = paddle.nn.loss.CrossEntropyLoss()
      dur = []
      best_test = []
      # 10 fixed seeds for random splits.
      SEEDS = [
          1941488137,
          4198936517,
          983997847,
          4023022221,
          4019585660,
          2108550661,
          1648766618,
          629014539,
          3212139042,
          2424918363,
      ]
  
      for run in tqdm.tqdm(range(args.runs)):
          args.seed = SEEDS[run]
          dataset = load_data(args.dataset, args.seed)
  
          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
  
          cal_val_acc = []
          cal_test_acc = []
          cal_val_loss = []
          cal_test_loss = []
          gnn_model = ChebNetII(
              input_size=graph.node_feat["words"].shape[1],
              num_class=dataset.num_classes,
              hidden_size=args.hidden,
              K=args.K,
              drop=args.dropout,
              dprate=args.dprate,
          )
          optim = []
          optim1 = Adam(
              learning_rate=args.lr,
              parameters=gnn_model.linear_1.parameters(),
              weight_decay=args.weight_decay,
          )
          optim2 = Adam(
              learning_rate=args.lr,
              parameters=gnn_model.linear_2.parameters(),
              weight_decay=args.weight_decay,
          )
          optim3 = Adam(
              learning_rate=args.prop_lr,
              parameters=gnn_model.prop.parameters(),
              weight_decay=args.prop_wd,
          )
          optim.append(optim1)
          optim.append(optim2)
          optim.append(optim3)
  
          best_val_acc = test_acc = 0
          best_val_loss = float("inf")
          val_loss_history = []
          val_acc_history = []
          for epoch in 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
              )
              test_loss, tmp_test_acc = eval(
                  test_index, test_label, gnn_model, graph, criterion
              )
  
              if val_loss < best_val_loss:
                  best_val_acc = val_acc
                  best_val_loss = val_loss
                  test_acc = tmp_test_acc
                  TEST = gnn_model.prop.temp.clone()
                  theta = F.relu(TEST.detach().cpu()).numpy()
  
              if epoch >= 0:
                  val_loss_history.append(val_loss.numpy())
                  val_acc_history.append(val_acc.numpy())
  
                  if (
                      args.early_stopping > 0
                      and epoch > args.early_stopping
                  ):
                      tmp = val_loss_history[
                          -(args.early_stopping + 1) : -1
                      ]
                      if val_loss > np.mean(tmp):
                          # print('The sum of epochs:',epoch)
                          break
          # if theta is not None:
          #    print('The coe of '+args.net+' is:', theta)
          log.info(
              "Runs %s: Model: Best Test Accuracy: %f" % (run, test_acc)
          )
          best_test.append(test_acc)
      log.info("Average Speed %s ms/ epoch" % (np.mean(dur) * 1000))
      log.info(
          "Dataset: %s Best Test Accuracy: %f ± %f "
          % (
              args.dataset,
              np.mean(best_test) * 100,
              np.std(best_test) * 100,
          )
      )
  
file_path: PGL/examples/chebnetii/train.py
imports: import pgl
  import paddle
  import paddle.nn
  from pgl.utils.logger import log
  import paddle.nn.functional
  import numpy
  import time
  import argparse
  import yaml
  from easydict import EasyDict
  import tqdm
  from paddle.optimizer import Adam
  from utils import load_data
  from model import ChebNetII
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types