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

The attention value of all edges of a node is almost equal #64

Open
Yaoyuanzhou opened this issue Dec 23, 2020 · 2 comments
Open

The attention value of all edges of a node is almost equal #64

Yaoyuanzhou opened this issue Dec 23, 2020 · 2 comments

Comments

@Yaoyuanzhou
Copy link

hello.

I pulled out one of the attention value matrices and observed, but I found that all the edges of a node are almost the same.
And the value is 1/n, n is the number of edges on that node.
This indicates that GAT has not learned the importance of the corresponding edge, which is almost similar to GCN.
The figure below shows the corresponding attention values for adjacent edges of some nodes in the Cora dataset (the same is true for the Citeseer dataset).

Why does this happen

image

@PetarV-
Copy link
Owner

PetarV- commented Dec 23, 2020

Hi, and thank you for your issue!

The effect here usually occurs on homophilous datasets (of which Cora and Citeseer are definite cases). By definition, in such datasets, the edges often merely indicate that classes should be shared, so most of the performance can be recovered by something that resembles simple averaging. It is therefore in GATs' interest to learn a distribution that is close to uniform.

This effect does not happen on PPI.
Check out this blog-post from the Deep Graph Library team, which explores this effect detailedly:

https://docs.dgl.ai/en/0.4.x/tutorials/models/1_gnn/9_gat.html

Hope that helps!

Thanks,
Petar

@Yaoyuanzhou
Copy link
Author

Thank you for your reply, which was very helpful to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants