class_docstr: KGNN-LS is a knowledge-based recommendation model.
  KGNN-LS transforms the knowledge graph into a user-specific weighted graph and then apply a graph neural network to
  compute personalized item embeddings. To provide better inductive bias, KGNN-LS relies on label smoothness
  assumption, which posits that adjacent items in the knowledge graph are likely to have similar user relevance
  labels/scores. Label smoothness provides regularization over the edge weights and it is equivalent  to a label
  propagation scheme on a graph.
code: def __init__(self, config, dataset):
      super(KGNNLS, self).__init__(config, dataset)
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      self.neighbor_sample_size = config["neighbor_sample_size"]
      self.aggregator_class = config[
          "aggregator"
      ]  # which aggregator to use
      # number of iterations when computing entity representation
      self.n_iter = config["n_iter"]
      self.reg_weight = config[
          "reg_weight"
      ]  # weight of l2 regularization
      # weight of label Smoothness regularization
      self.ls_weight = config["ls_weight"]
  
      # 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 and construct interaction table
      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)
  
      inter_feat = dataset.inter_feat
      pos_users = inter_feat[dataset.uid_field]
      pos_items = inter_feat[dataset.iid_field]
      pos_label = torch.ones(pos_items.shape)
      pos_interaction_table, self.offset = self.get_interaction_table(
          pos_users, pos_items, pos_label
      )
      self.interaction_table = self.sample_neg_interaction(
          pos_interaction_table, self.offset
      )
  
      # 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"]
  
imports: import random
  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 KGNNLS object from inherited base classes: KnowledgeRecommender with example: obj = KGNNLS(config, dataset)