code: def __init__(self, cfg, num_entities, num_relations):
      super(KGC, self).__init__()
      self.cfg = cfg
      self.num_entities = num_entities
      self.num_relations = num_relations
      if cfg["model"] is None:
          model = ConvE(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      elif cfg["model"] == "conve":
          model = ConvE(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      elif cfg["model"] == "distmult":
          model = Distmult(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      elif cfg["model"] == "complex":
          model = Complex(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      elif cfg["model"] == "ggnn_distmult":
          model = GGNNDistMult(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      elif cfg["model"] == "gcn_distmult":
          model = GCNDistMult(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      elif cfg["model"] == "gcn_complex":
          model = GCNComplex(
              argparse.Namespace(**cfg), num_entities, num_relations
          )
      else:
          raise Exception("Unknown model type!")
  
      self.model = model
  
imports: import argparse
  import os
  import numpy
  import torch
  import torch.backends.cudnn
  import torch.nn
  from torch.utils.data import DataLoader
  from graph4nlp.pytorch.datasets.kinship import KinshipDataset
  from graph4nlp.pytorch.modules.utils.config_utils import get_yaml_config
  from graph4nlp.pytorch.modules.utils.logger import Logger
  from .model import Complex, ConvE, Distmult, GCNComplex, GCNDistMult, GGNNDistMult
label_desc: Use image node_id 1 to create a new KGC object from inherited base classes: nn with example: obj = KGC(cfg, num_entities, num_relations)