Skip to content

LightGCN bug fixes #7384

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

Merged
merged 6 commits into from
May 19, 2023
Merged

LightGCN bug fixes #7384

merged 6 commits into from
May 19, 2023

Conversation

happykygo
Copy link
Contributor

  1. In BPRLoss(_Loss)::forward, log_prob is divided by n_pairs twice. Changed the return clause to: return -log_prob + regularization / n_pairs

  2. In LightGCN()::recommendation_loss, it calls BPRLoss::forward and passes in the embeddings of all nodes. It should pass in only the embeddings of the nodes in the mini-batch.

1. In BPRLoss(_Loss)::forward, log_prob is divided by n_pairs twice. Changed the return clause to: return -log_prob + regularization / n_pairs

2. In LightGCN()::recommendation_loss, it calls BPRLoss::forward and passes in the embeddings of all nodes. It should pass in only the embeddings of the nodes in the mini-batch.
@rusty1s rusty1s linked an issue May 17, 2023 that may be closed by this pull request
@rusty1s rusty1s changed the title LightGCN bug fix #7196: LightGCN bug fixes May 17, 2023
@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Merging #7384 (174f14f) into master (ec8fba0) will decrease coverage by 0.40%.
The diff coverage is 100.00%.

❗ Current head 174f14f differs from pull request most recent head 648008d. Consider uploading reports for the commit 648008d to get more accurate results

@@            Coverage Diff             @@
##           master    #7384      +/-   ##
==========================================
- Coverage   91.71%   91.32%   -0.40%     
==========================================
  Files         440      440              
  Lines       24561    24560       -1     
==========================================
- Hits        22526    22429      -97     
- Misses       2035     2131      +96     
Impacted Files Coverage Δ
torch_geometric/nn/models/lightgcn.py 95.06% <100.00%> (+0.12%) ⬆️

... and 20 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rusty1s rusty1s enabled auto-merge (squash) May 19, 2023 07:14
@rusty1s rusty1s merged commit 15573f4 into pyg-team:master May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BPRLoss implementation in torch_geometric.nn.models.lightgcn
2 participants