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

Request to add PairNorm: Tackling Oversmoothing in GNNs #715

Closed
WMF1997 opened this issue Oct 2, 2019 · 2 comments
Closed

Request to add PairNorm: Tackling Oversmoothing in GNNs #715

WMF1997 opened this issue Oct 2, 2019 · 2 comments
Labels

Comments

@WMF1997
Copy link

WMF1997 commented Oct 2, 2019

🚀 Feature

hello @rusty1s
After the discussion in #705 , and I mentioned something about "Normalization on Graph" here

I find a paper here. PAIRNORM: TACKLING OVERSMOOTHING IN GNNS

Motivation

Normalization on Graphs is a good idea, especially when it is used in node classification, as mentioned in the paper above. What's more, comparing with CNNs, we may neglect the Normalization, or we use the normalization in regular grids and find it okay in graph data.
in conclusion, normalization "specially designed" for graphs is seldom mentioned before.

Additional context

no.

yours sincerely,
@WMF1997

@rusty1s
Copy link
Member

rusty1s commented Oct 2, 2019

Hi, thank you for this feature request. This is an interesting method, and we should definitively support it. Eq. (10) and (11) can be easily implemented within PyG (untested):

x_c = x - scatter_mean(x, batch, dim=0, dim_size=num_graphs)[batch]
out = s * x_c / scatter_mean((x_c * x_c).sum(dim=-1, keepdim=True),
                             batch, dim=0, dim_size=num_graphs).sqrt()[batch]

Feel free to submit a PR if you like. Otherwise, I will try to add it to the repository as soon as I am able to. We should add nn.norm to the repository (and also add implementations for BatchNorm and InstanceNorm to it).

@rusty1s rusty1s added the feature label Oct 2, 2019
@rusty1s
Copy link
Member

rusty1s commented Oct 27, 2022

PairNorm is now integrated into PyG.

@rusty1s rusty1s closed this as completed Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants