triplet_recommendations_keras icon indicating copy to clipboard operation
triplet_recommendations_keras copied to clipboard

Please,I have a problem with your function "bpr_triplet_loss"...

Open zhhengcs opened this issue 7 years ago • 1 comments

I saw you have use "K.sum(user_latent * positive_item_latent, axis=-1, keepdims=True)",but in my keras with tensorflow backend,this "*" means point-wise multiplication. I think we should compute the cos similarity between user and pos-items,so why Why don't we use "K.batch_dot(K.l2_normalize(x,axis = -1),K.l2_normalize(y,axis=-1))"? Thank you for your answer and help!

zhhengcs avatar Nov 20 '17 13:11 zhhengcs

For BPR we want dot products, not cosine similarity (at least it's defined that way in the paper).

K.batch_dot may still be useful, though.

maciejkula avatar Nov 21 '17 17:11 maciejkula