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

Add LinkEncoder of GraphMixer #7459

Merged
merged 43 commits into from
Jun 19, 2023

Conversation

akihironitta
Copy link
Member

This PR introduces the "link-encoder" defined in 3.1 of the GraphMixer paper, Do We Really Need Complicated Model Architectures For Temporal Networks?.

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #7459 (13aa6a1) into master (4ebd80e) will decrease coverage by 0.31%.
The diff coverage is 98.61%.

❗ Current head 13aa6a1 differs from pull request most recent head f07f379. Consider uploading reports for the commit f07f379 to get more accurate results

@@            Coverage Diff             @@
##           master    #7459      +/-   ##
==========================================
- Coverage   91.89%   91.59%   -0.31%     
==========================================
  Files         452      452              
  Lines       25292    25360      +68     
==========================================
- Hits        23243    23229      -14     
- Misses       2049     2131      +82     
Impacted Files Coverage Δ
torch_geometric/nn/encoding.py 100.00% <ø> (ø)
torch_geometric/nn/models/graph_mixer.py 98.82% <98.61%> (-1.18%) ⬇️

... and 17 files with indirect coverage changes

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

@akihironitta akihironitta force-pushed the feat/graph-mixer-link-encoder branch from 22e05e2 to 8006e2b Compare June 2, 2023 15:01
@akihironitta akihironitta marked this pull request as ready for review June 2, 2023 15:28
Copy link

@weihua916 weihua916 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Quick initial comment.

test/nn/test_encoding.py Outdated Show resolved Hide resolved
Copy link

@weihua916 weihua916 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Quick initial comment.

test/nn/test_encoding.py Outdated Show resolved Hide resolved
torch_geometric/nn/encoding.py Outdated Show resolved Hide resolved
torch_geometric/nn/encoding.py Outdated Show resolved Hide resolved
Copy link

@weihua916 weihua916 left a comment

Choose a reason for hiding this comment

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

Thanks for the hard work. My final round of comments to address.

Comment on lines 274 to 278
edge_attr_time, _ = to_dense_batch(
edge_attr_time,
edge_index[1],
max_num_nodes=self.K,
batch_size=num_nodes,
Copy link

@weihua916 weihua916 Jun 11, 2023

Choose a reason for hiding this comment

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

That's a good point. If a destination node has degree larger than K, we will need to include K mst recent edges, i.e., largest K elements based on edge_time for the destination node.

test/nn/test_encoding.py Outdated Show resolved Hide resolved
@rusty1s
Copy link
Member

rusty1s commented Jun 13, 2023

I think this looks all good. Let's try to get this in. My only concern is that we should move this functionality to nn/models/graph_mixer.py.

Copy link
Member

@wsad1 wsad1 left a comment

Choose a reason for hiding this comment

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

@akihironitta Thanks for the great work.
@weihua916 I updated the PR, the latest K edge attributes are used to create the node embedding now. Appreciate review and approval from you before we merge.

Copy link

@weihua916 weihua916 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the great work.

torch_geometric/nn/models/graph_mixer.py Show resolved Hide resolved
@wsad1 wsad1 enabled auto-merge (squash) June 19, 2023 04:42
torch_geometric/nn/models/graph_mixer.py Outdated Show resolved Hide resolved
torch_geometric/nn/models/graph_mixer.py Outdated Show resolved Hide resolved
torch_geometric/nn/models/graph_mixer.py Outdated Show resolved Hide resolved
@wsad1 wsad1 merged commit c33c481 into pyg-team:master Jun 19, 2023
11 of 12 checks passed
@akihironitta akihironitta deleted the feat/graph-mixer-link-encoder branch June 28, 2023 11:27
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.

None yet

5 participants