code: def main(args):
      """main function for training node classification task."""
      words_label = load_data(args.dataset)
  
      # split data for training and testing
      split_position = int(words_label.shape[0] * args.train_percent)
      train_words_label = words_label[0:split_position, :]
      test_words_label = words_label[split_position:, :]
  
      place = fluid.CUDAPlace(0) if args.use_cuda else fluid.CPUPlace()
      train_prog = fluid.Program()
      test_prog = fluid.Program()
      startup_prog = fluid.Program()
  
      with fluid.program_guard(train_prog, startup_prog):
          with fluid.unique_name.guard():
              model = node_classify_model(args)
  
      test_prog = train_prog.clone(for_test=True)
  
      with fluid.program_guard(train_prog, startup_prog):
          lr = fl.polynomial_decay(args.lr, 1000, 0.001)
          adam = fluid.optimizer.Adam(lr)
          adam.minimize(model["loss"])
  
      exe = fluid.Executor(place)
      exe.run(startup_prog)
  
      def existed_params(var):
          if not isinstance(var, fluid.framework.Parameter):
              return False
          return os.path.exists(os.path.join(args.ckpt_path, var.name))
  
      fluid.io.load_vars(
          exe,
          args.ckpt_path,
          main_program=train_prog,
          predicate=existed_params,
      )
      #  load_param(args.ckpt_path, ['content'])
  
      feed_dict = {}
      X = train_words_label[:, 0].reshape(-1, 1)
      labels = train_words_label[:, 1].reshape(-1, 1)
      logging.info(
          "%d/%d data to train"
          % (labels.shape[0], words_label.shape[0])
      )
  
      test_feed_dict = {}
      test_X = test_words_label[:, 0].reshape(-1, 1)
      test_labels = test_words_label[:, 1].reshape(-1, 1)
      logging.info(
          "%d/%d data to test"
          % (test_labels.shape[0], words_label.shape[0])
      )
  
      for epoch in range(args.epochs):
          feed_dict["nodes"] = X
          feed_dict["labels"] = labels
          train_result = run_epoch(
              exe, train_prog, model, feed_dict, lr
          )
  
          test_feed_dict["nodes"] = test_X
          test_feed_dict["labels"] = test_labels
  
          test_result = run_epoch(
              exe, test_prog, model, test_feed_dict, lr=None
          )
  
          logging.info(
              "epoch %d | lr %.4f | train_loss %.5f | train_macro_F1 %.4f | train_micro_F1 %.4f | test_loss %.5f | test_macro_F1 %.4f | test_micro_F1 %.4f"
              % (
                  epoch,
                  train_result["lr"],
                  train_result["loss"],
                  train_result["macro_f1"],
                  train_result["micro_f1"],
                  test_result["loss"],
                  test_result["macro_f1"],
                  test_result["micro_f1"],
              )
          )
  
      logging.info(
          "final_test_macro_f1 score: %.4f | final_test_micro_f1 score: %.4f"
          % (test_result["macro_f1"], test_result["micro_f1"])
      )
  
file_path: PGL/legacy/examples/distribute_metapath2vec/multi_class.py
imports: import argparse
  import sys
  import os
  import tqdm
  import time
  import math
  import logging
  import random
  import pickle
  import numpy
  import sklearn.metrics
  from sklearn.metrics import f1_score
  import pgl
  import paddle.fluid
  import paddle.fluid.layers
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) and returns: os, False