code: def main(args):
      dataset = build_dataset_from_name("hetero-acm-han")
      field = dataset.schema["target_node_type"]
      g = dataset[0].to(args["device"])
  
      labels = g.nodes[field].data["label"]
      num_classes = labels.max().item() + 1
  
      # features = features.to(args['device'])
      labels = labels.to(args["device"])
      train_mask = g.nodes[field].data["train_mask"].to(args["device"])
      val_mask = g.nodes[field].data["val_mask"].to(args["device"])
      test_mask = g.nodes[field].data["test_mask"].to(args["device"])
  
      num_features = g.nodes[field].data["feat"].shape[1]
      num_classes = labels.max().item() + 1
      accs = []
  
      for seed in tqdm(range(args["repeat"])):
          set_seed(seed)
          if args["model"] == "han":
              model_hp = {
                  "num_layers": 2,
                  "hidden": [256],  ##
                  "heads": [8],  ##
                  "dropout": 0.2,
                  "act": "gelu",
              }
          trainer = NodeClassificationHetTrainer(
              model=args["model"],
              dataset=dataset,
              num_features=num_features,
              num_classes=num_classes,
              device=args["device"],
              init=False,
              feval=["acc"],
              loss="cross_entropy",
              optimizer=torch.optim.AdamW,
          ).duplicate_from_hyper_parameter(
              {
                  "trainer": {
                      "max_epoch": args["num_epochs"],
                      "early_stopping_round": args["num_epochs"] + 1,
                      "lr": args["lr"],
                      "weight_decay": args["weight_decay"],
                  },
                  "encoder": model_hp,
              }
          )
  
          trainer.train(dataset, False)
          acc = trainer.evaluate(dataset, "test", "acc")
          print(acc)
          accs.append(acc)
      print("{:.4f} ~ {:.4f}".format(np.mean(accs), np.std(accs)))
  
file_path: AutoGL/test/performance/heterogeneous/dgl/train_han.py
imports: import os
  import numpy
  from tqdm import tqdm
  import torch
  import random
  from autogl.module.train import NodeClassificationHetTrainer
  from autogl.solver.utils import set_seed
  import logging
  from autogl.datasets import build_dataset_from_name
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types