Skip to contents

\(-1/N_S \\sum_j \\log\\sigma(r_i - r_j)\), with the log floored at 1e-12 for numerical stability.

Usage

morie_gru4r_bpr(r_target, r_negatives)

Arguments

r_target

Score of the target item.

r_negatives

Numeric vector of negative-item scores.

Value

Scalar loss.

Examples

morie_gru4r_bpr(r_target = 2, r_negatives = c(0.5, 1, -1))
#> [1] 0.1877541