Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BPR loss implementation question #33

Open
msemikin opened this issue Mar 24, 2019 · 0 comments
Open

BPR loss implementation question #33

msemikin opened this issue Mar 24, 2019 · 0 comments

Comments

@msemikin
Copy link

msemikin commented Mar 24, 2019

Hi, I have a question about the mini-batch sampled BPR loss. The code is as follows:

def bpr(self, yhat, M):
    return T.cast(T.mean(-T.log(T.nnet.sigmoid(gpu_diag_wide(yhat).dimshuffle((0, 'x'))-yhat))), theano.config.floatX)

Do I understand correctly, that the score for the positive item is also considered as one of the negative scores? Positive score is not filtered from the negative scores list. Sigmoid of 0 difference between positive and negative here will be 0.5 and negative log contribution to loss will be 0.7 from the positive score itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant