code: def bpr_loss(self, users, pos, neg):
      users_emb, pos_emb, neg_emb = self.getEmbedding(
          users.astype("int32"),
          pos.astype("int32"),
          neg.astype("int32"),
      )
  
      reg_loss = (
          (1 / 2)
          * (
              users_emb.norm(2).pow(2)
              + pos_emb.norm(2).pow(2)
              + neg_emb.norm(2).pow(2)
          )
          / float(len(users))
      )
      pos_scores = paddle.multiply(users_emb, pos_emb)
      pos_scores = paddle.sum(pos_scores, axis=1)
      neg_scores = paddle.multiply(users_emb, neg_emb)
      neg_scores = paddle.sum(neg_scores, axis=1)
  
      loss = nn.LogSigmoid()(pos_scores - neg_scores)
  
      loss = -1 * paddle.mean(loss)
      return loss, reg_loss
  
imports: import paddle
  import paddle.nn
  from dataloader import BasicDataset
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import pgl
  from pgl.nn import functional
  from tqdm import tqdm
label_desc: Use image node_id 5 for calling the NGCF obj's underlying member method code with example usage: obj.bpr_loss(users, pos, neg) and returns: loss,  reg_loss