class_docstr: LightGCN model
  
  :Citation:
  
      He, Xiangnan, Kuan Deng, Xiang Wang, Yan Li, Yongdong Zhang, and Meng Wang.
      "LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation." arXiv
      preprint arXiv:2002.02126, 2020.
docstr: Calculate BPR loss.
  
  Args:
      users (tf.Tensor): User embeddings to calculate loss.
      pos_items (tf.Tensor): Positive item embeddings to calculate loss.
      neg_items (tf.Tensor): Negative item embeddings to calculate loss.
  
  Returns:
      tf.Tensor, tf.Tensor: Matrix factorization loss. Embedding regularization loss.
docstr_tok: ["Calculate","BPR","loss",".","Args",":","users","(","tf.Tensor",")",":","User","embeddings","to","calculate","loss",".","pos_items","(","tf.Tensor",")",":","Positive","item","embeddings","to","calculate","loss",".","neg_items","(","tf.Tensor",")",":","Negative","item","embeddings","to","calculate","loss",".","Returns",":","tf.Tensor",",","tf.Tensor",":","Matrix","factorization","loss",".","Embedding","regularization","loss","."]
code: def _create_bpr_loss(self, users, pos_items, neg_items):
      """Calculate BPR loss.
  
      Args:
          users (tf.Tensor): User embeddings to calculate loss.
          pos_items (tf.Tensor): Positive item embeddings to calculate loss.
          neg_items (tf.Tensor): Negative item embeddings to calculate loss.
  
      Returns:
          tf.Tensor, tf.Tensor: Matrix factorization loss. Embedding regularization loss.
  
      """
      pos_scores = tf.reduce_sum(
          input_tensor=tf.multiply(users, pos_items), axis=1
      )
      neg_scores = tf.reduce_sum(
          input_tensor=tf.multiply(users, neg_items), axis=1
      )
  
      regularizer = (
          tf.nn.l2_loss(self.u_g_embeddings_pre)
          + tf.nn.l2_loss(self.pos_i_g_embeddings_pre)
          + tf.nn.l2_loss(self.neg_i_g_embeddings_pre)
      )
      regularizer = regularizer / self.batch_size
      mf_loss = tf.reduce_mean(
          input_tensor=tf.nn.softplus(-(pos_scores - neg_scores))
      )
      emb_loss = self.decay * regularizer
      return mf_loss, emb_loss
  
imports: import tensorflow
  import time
  import os
  import sys
  import numpy
  import pandas
  from recommenders.evaluation.python_evaluation import map_at_k, ndcg_at_k, precision_at_k, recall_at_k
  from recommenders.utils.python_utils import get_top_k_scored_items
label_desc: Use image node_id 4 for calling the LightGCN obj's underlying member method code with example usage: obj._create_bpr_loss(users, pos_items, neg_items) and returns: mf_loss,  emb_loss