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 a normalize parameter to dense_diff_pool #4847

Merged
merged 6 commits into from
Jun 23, 2022

Conversation

Hu-Chuxuan
Copy link
Contributor

I did this modification because:

While I was using this function, I found the link_loss being exceptionally small and thus almost not contributing anything, making the graph structure hard to preserve and all nodes resulting in a few clusters. This is because adj.numel() are generally very large. After I recovered the result by multiplying adj.numel() back, results became reasonable.

According to the original paper, the link_loss is not divided by the size of adjacency matrix
image
image

After communicating with people on slack, I think it makes more sense for us to allow users to have an option of not being normalized.

@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #4847 (05a3e4c) into master (97c50a0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 05a3e4c differs from pull request most recent head 4a0fdc5. Consider uploading reports for the commit 4a0fdc5 to get more accurate results

@@           Coverage Diff           @@
##           master    #4847   +/-   ##
=======================================
  Coverage   82.71%   82.71%           
=======================================
  Files         326      326           
  Lines       17520    17521    +1     
=======================================
+ Hits        14491    14492    +1     
  Misses       3029     3029           
Impacted Files Coverage Δ
torch_geometric/nn/dense/diff_pool.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97c50a0...4a0fdc5. Read the comment docs.

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.

looks good to me.

CHANGELOG.md Outdated Show resolved Hide resolved
torch_geometric/nn/dense/diff_pool.py Outdated Show resolved Hide resolved
torch_geometric/nn/dense/diff_pool.py Show resolved Hide resolved
rusty1s and others added 2 commits June 23, 2022 13:09
Co-authored-by: Jinu Sunil <jinu.sunil@gmail.com>
@rusty1s rusty1s changed the title Add normalize parameter to dense_diffpool Add normalize parameter to dense_diffpool Jun 23, 2022
@rusty1s rusty1s changed the title Add normalize parameter to dense_diffpool Add a normalize parameter to dense_diff_pool Jun 23, 2022
@rusty1s rusty1s merged commit 85cddb3 into pyg-team:master Jun 23, 2022
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