Skip to content

Add bipartite GraphSAGE example #5834

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 26 commits into from
Nov 18, 2022
Merged

Add bipartite GraphSAGE example #5834

merged 26 commits into from
Nov 18, 2022

Conversation

husimplicity
Copy link
Contributor

This PR adds an example implementation of a recommendation model bipartite Graphsage.
The current implementation is a supervised version on MovieLens. The i2i co-occurrence matrix is applied to construct i2i-graph. When applying Graphsage, the model follows i-i-i pattern to encode item embedding and i-i-u for user-side respectively. Since the task to predict u2i rates is supervised, we apply MSE loss with labels.
For next step, we will apply this model to an unsupervised task on another dataset with negative sampling and triplet loss.

@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Merging #5834 (4aaa8df) into master (964a447) will decrease coverage by 1.93%.
The diff coverage is n/a.

❗ Current head 4aaa8df differs from pull request most recent head 375be81. Consider uploading reports for the commit 375be81 to get more accurate results

@@            Coverage Diff             @@
##           master    #5834      +/-   ##
==========================================
- Coverage   86.48%   84.54%   -1.94%     
==========================================
  Files         361      361              
  Lines       19882    19877       -5     
==========================================
- Hits        17195    16806     -389     
- Misses       2687     3071     +384     
Impacted Files Coverage Δ
torch_geometric/nn/models/dimenet_utils.py 0.00% <0.00%> (-75.52%) ⬇️
torch_geometric/nn/models/dimenet.py 14.90% <0.00%> (-52.76%) ⬇️
torch_geometric/profile/profile.py 36.73% <0.00%> (-27.56%) ⬇️
torch_geometric/nn/conv/utils/typing.py 81.25% <0.00%> (-17.50%) ⬇️
torch_geometric/nn/pool/asap.py 92.10% <0.00%> (-7.90%) ⬇️
torch_geometric/nn/inits.py 67.85% <0.00%> (-7.15%) ⬇️
torch_geometric/nn/dense/linear.py 87.40% <0.00%> (-5.93%) ⬇️
torch_geometric/transforms/add_self_loops.py 94.44% <0.00%> (-5.56%) ⬇️
torch_geometric/nn/models/attentive_fp.py 95.83% <0.00%> (-4.17%) ⬇️
torch_geometric/nn/resolver.py 86.36% <0.00%> (-3.41%) ⬇️
... and 12 more

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

@rusty1s rusty1s changed the title Add Bipartite GraphSage example Add bipartite GraphSAGE example Oct 29, 2022
Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool, thanks for adding! Left a few comments.

@husimplicity husimplicity requested a review from rusty1s November 16, 2022 17:17
@rusty1s rusty1s enabled auto-merge (squash) November 18, 2022 14:35
@rusty1s rusty1s merged commit 434b520 into pyg-team:master Nov 18, 2022
jjpietrak pushed a commit to jjpietrak/pytorch_geometric that referenced this pull request Nov 25, 2022
This PR adds an example implementation of a recommendation model
bipartite Graphsage.
The current implementation is a supervised version on MovieLens. The i2i
co-occurrence matrix is applied to construct i2i-graph. When applying
Graphsage, the model follows i-i-i pattern to encode item embedding and
i-i-u for user-side respectively. Since the task to predict u2i rates is
supervised, we apply MSE loss with labels.
For next step, we will apply this model to an unsupervised task on
another dataset with negative sampling and triplet loss.

Co-authored-by: 胡树弦 <[email protected]>
Co-authored-by: huxleyhu <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: huxleyhu <[email protected]>
Co-authored-by: Matthias Fey <[email protected]>
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.

3 participants