RUCAIBox / NCL

[WWW'22] Official PyTorch implementation for "Improving Graph Collaborative Filtering with Neighborhood-enriched Contrastive Learning".
118 stars 20 forks source link

The loss function may calculate one user/item repeatedly? #37

Closed scytdk closed 1 year ago

scytdk commented 1 year ago

Dear authors! I notice that when calculating the ssl layer loss and protoNCE loss, you seem to input the users and items per batch, while in every batch the users and items are gained by the interaction, so the loss function may calculate one user/item repeatedly? This may be not consistent to the equation (6) (7) (9) (10), where one user/item just contributes to the loss for one time. I am new in Recommedation, and I am pretty confused about this. Hope for your timely answer!

linzihan-backforward commented 1 year ago

Hello, sorry for late reply! You are right, the ssl loss and protoNCE loss are calculated repeatedly for each user/item which is not essentially consistent to the equation in our paper. However, it is not necessary to make all user/item contribute equally in the implementation as we should pay more attention to the representation of those active users/items. And the underlying principle is the same.

scytdk commented 1 year ago

I understand it. Thanks for your reply.