BPRLoss
- class dhg.nn.BPRLoss(*args, **kwargs)[source]
Bases:
torch.nn.ModuleThis criterion computes the Bayesian Personalized Ranking (BPR) loss between the positive scores and the negative scores.
- Parameters
alpha (
float, optional) – The weight for the positive scores in the BPR loss. Defaults to1.0.beta (
float, optional) – The weight for the negative scores in the BPR loss. Defaults to1.0.activation (
str, optional) – The activation function to use can be one of"sigmoid_then_log","softplus". Defaults to"sigmoid_then_log".