code: def create_bpr_loss(self, users, pos_items, neg_items):
      pos_scores = (users * pos_items).sum(1)
      neg_scores = (users * neg_items).sum(1)
  
      mf_loss = nn.LogSigmoid()(pos_scores - neg_scores).mean()
      mf_loss = -1 * mf_loss
  
      regularizer = (
          torch.norm(users) ** 2
          + torch.norm(pos_items) ** 2
          + torch.norm(neg_items) ** 2
      ) / 2
      emb_loss = self.lmbd * regularizer / users.shape[0]
  
      return mf_loss + emb_loss, mf_loss, emb_loss
  
file_path: dgl/examples/pytorch/NGCF/NGCF/model.py
imports: import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the NGCF obj's underlying member method code with example usage: obj.create_bpr_loss(users, pos_items, neg_items) and returns: unknown,  mf_loss,  emb_loss