class_docstr: BPRLoss, based on Bayesian Personalized Ranking
  
  Args:
      - gamma(float): Small value to avoid division by zero
  
  Shape:
      - Pos_score: (N)
      - Neg_score: (N), same shape as the Pos_score
      - Output: scalar.
  
  Examples::
  
      >>> loss = BPRLoss()
      >>> pos_score = torch.randn(3, requires_grad=True)
      >>> neg_score = torch.randn(3, requires_grad=True)
      >>> output = loss(pos_score, neg_score)
      >>> output.backward()
class_docstr_tok: ["BPRLoss",",","based","on","Bayesian","Personalized","Ranking","Args",":","-","gamma","(","float",")",":","Small","value","to","avoid","division","by","zero","Shape",":","-","Pos_score",":","(","N",")","-","Neg_score",":","(","N",")",",","same","shape","as","the","Pos_score","-","Output",":","scalar",".","Examples",":",":",">",">",">","loss","=","BPRLoss","(",")",">",">",">","pos_score","=","torch.randn","(","3",",","requires_grad=True",")",">",">",">","neg_score","=","torch.randn","(","3",",","requires_grad=True",")",">",">",">","output","=","loss","(","pos_score",",","neg_score",")",">",">",">","output.backward","(",")"]
code: def forward(self, pos_score, neg_score):
      loss = -torch.log(
          self.gamma + torch.sigmoid(pos_score - neg_score)
      ).mean()
      return loss
  
file_path: RecBole/recbole/model/loss.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the BPRLoss obj's underlying member method code with example usage: obj.forward(pos_score, neg_score) and returns: loss