class_docstr: KGCN is a knowledge-based recommendation model that captures inter-item relatedness effectively by mining their
  associated attributes on the KG. To automatically discover both high-order structure information and semantic
  information of the KG, we treat KG as an undirected graph and sample from the neighbors for each entity in the KG
  as their receptive field, then combine neighborhood information with bias when calculating the representation of a
  given entity.
class_docstr_tok: ["KGCN","is","a","knowledge-based","recommendation","model","that","captures","inter-item","relatedness","effectively","by","mining","their","associated","attributes","on","the","KG",".","To","automatically","discover","both","high-order","structure","information","and","semantic","information","of","the","KG",",","we","treat","KG","as","an","undirected","graph","and","sample","from","the","neighbors","for","each","entity","in","the","KG","as","their","receptive","field",",","then","combine","neighborhood","information","with","bias","when","calculating","the","representation","of","a","given","entity","."]
code: def __init__(self, config, dataset):
      super(KGCN, self).__init__(config, dataset)
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      # number of iterations when computing entity representation
      self.n_iter = config["n_iter"]
      self.aggregator_class = config[
          "aggregator"
      ]  # which aggregator to use
      self.reg_weight = config[
          "reg_weight"
      ]  # weight of l2 regularization
      self.neighbor_sample_size = config["neighbor_sample_size"]
  
      # define embedding
      self.user_embedding = nn.Embedding(
          self.n_users, self.embedding_size
      )
      self.entity_embedding = nn.Embedding(
          self.n_entities, self.embedding_size
      )
      self.relation_embedding = nn.Embedding(
          self.n_relations + 1, self.embedding_size
      )
  
      # sample neighbors
      kg_graph = dataset.kg_graph(form="coo", value_field="relation_id")
      adj_entity, adj_relation = self.construct_adj(kg_graph)
      self.adj_entity, self.adj_relation = adj_entity.to(
          self.device
      ), adj_relation.to(self.device)
  
      # define function
      self.softmax = nn.Softmax(dim=-1)
      self.linear_layers = torch.nn.ModuleList()
      for i in range(self.n_iter):
          self.linear_layers.append(
              nn.Linear(
                  self.embedding_size
                  if not self.aggregator_class == "concat"
                  else self.embedding_size * 2,
                  self.embedding_size,
              )
          )
      self.ReLU = nn.ReLU()
      self.Tanh = nn.Tanh()
  
      self.bce_loss = nn.BCEWithLogitsLoss()
      self.l2_loss = EmbLoss()
  
      # parameters initialization
      self.apply(xavier_normal_initialization)
      self.other_parameter_name = ["adj_entity", "adj_relation"]
  
file_path: RecBole/recbole/model/knowledge_aware_recommender/kgcn.py
imports: import numpy
  import torch
  import torch.nn
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.loss import EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new KGCN object from inherited base classes: KnowledgeRecommender with example: obj = KGCN(config, dataset)