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

Modify the implementation of sagpool so it is consistent with the description in paper #8562

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ChenYizhu97
Copy link

The current implementation of sagpool reuses the SelectTopK class, which introduces an extra learnable parameter that learns to take the negative value of the attention score or not.

The top k nodes should be selected by their attentions score attn, but in current implementation, the top k nodes are selected by attn*i/norm(i), where i is the extra learnable parameter. The value of i/norm(i) is 1 if i >0, -1 if i<0. That means when i<0 the current select function will return bottom k nodes.

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.72%. Comparing base (90e7604) to head (cb9a9a1).
Report is 411 commits behind head on master.

Files with missing lines Patch % Lines
torch_geometric/nn/pool/select/sag.py 92.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8562      +/-   ##
==========================================
- Coverage   88.73%   88.72%   -0.02%     
==========================================
  Files         479      480       +1     
  Lines       29847    29872      +25     
==========================================
+ Hits        26486    26504      +18     
- Misses       3361     3368       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants