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.
docstr: Sample neg_interaction to construct train data.
  
  Args:
      pos_interaction_table(dict): the interaction_table that only contains pos_interaction.
      offset(int): The offset that is used for calculating the key(index) in interaction_table
  
  Returns:
      interaction_table(dict): key: user_id * 10^offset + item_id; value: y_{user_id, item_id}
docstr_tok: ["Sample","neg_interaction","to","construct","train","data",".","Args",":","pos_interaction_table","(","dict",")",":","the","interaction_table","that","only","contains","pos_interaction",".","offset","(","int",")",":","The","offset","that","is","used","for","calculating","the","key","(","index",")","in","interaction_table","Returns",":","interaction_table","(","dict",")",":","key",":","user_id","*","10^offset","+","item_id",";","value",":","y_","{","user_id",",","item_id","}"]
code: def sample_neg_interaction(self, pos_interaction_table, offset):
      r"""Sample neg_interaction to construct train data.
  
      Args:
          pos_interaction_table(dict): the interaction_table that only contains pos_interaction.
          offset(int): The offset that is used for calculating the key(index) in interaction_table
  
      Returns:
          interaction_table(dict): key: user_id * 10^offset + item_id; value: y_{user_id, item_id}
      """
      pos_num = len(pos_interaction_table)
      neg_num = 0
      neg_interaction_table = {}
      while neg_num < pos_num:
          user_id = random.randint(0, self.n_users)
          item_id = random.randint(0, self.n_items)
          keys = user_id * offset + item_id
          if keys not in pos_interaction_table:
              neg_interaction_table[keys] = 0.0
              neg_num += 1
      interaction_table = {
          **pos_interaction_table,
          **neg_interaction_table,
      }
      return interaction_table
  
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 3 for calling the KGNNLS obj's underlying member method code with example usage: obj.sample_neg_interaction(pos_interaction_table, offset) and returns: interaction_table