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: Calculate label smoothness loss.
  
  Args:
      user(torch.FloatTensor): the index of users, shape: [batch_size*2],
      item(torch.FloatTensor): the index of items, shape: [batch_size*2],
      target(torch.FloatTensor): the label of user-item, shape: [batch_size*2],
  
  Returns:
      ls_loss: label smoothness loss
docstr_tok: ["Calculate","label","smoothness","loss",".","Args",":","user","(","torch.FloatTensor",")",":","the","index","of","users",",","shape",":","[","batch_size","*","2","]",",","item","(","torch.FloatTensor",")",":","the","index","of","items",",","shape",":","[","batch_size","*","2","]",",","target","(","torch.FloatTensor",")",":","the","label","of","user-item",",","shape",":","[","batch_size","*","2","]",",","Returns",":","ls_loss",":","label","smoothness","loss"]
code: def calculate_ls_loss(self, user, item, target):
      r"""Calculate label smoothness loss.
  
      Args:
          user(torch.FloatTensor): the index of users, shape: [batch_size*2],
          item(torch.FloatTensor): the index of items, shape: [batch_size*2],
          target(torch.FloatTensor): the label of user-item, shape: [batch_size*2],
  
      Returns:
          ls_loss: label smoothness loss
      """
      user_e = self.user_embedding(user)
      entities, relations = self.get_neighbors(item)
  
      predicted_labels = self.label_smoothness_predict(
          user_e, user, entities, relations
      )
      ls_loss = self.bce_loss(predicted_labels, target)
      return ls_loss
  
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 9 for calling the KGNNLS obj's underlying member method code with example usage: obj.calculate_ls_loss(user, item, target) and returns: ls_loss