-
Notifications
You must be signed in to change notification settings - Fork 72
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
About the Adjacent matrix #3
Comments
Hey, |
Thanks for your reply! When the adjacency matrix contains non-zero elements, it means that the nodes have self-loops, which might be necessary for some algorithms (e.g. for graph convolutions). Also it might look like it is a diagonal matrix because it is extremely sparse but it should certainly contain non-zero off-diagonal elements. I think I visualised it with matplotlib's imshow before, which should make that visible. |
Thanks. That is to say that you transform the adjacency matrix into a special form since the matrix is extremely sparse. |
The non-zero diagonal entries are not necessary because of the sparsity of the matrix but because of the way it is used, i.e. for graph convolutions. If the diagonal was zero, due to the way graph convolutions are implemented, the central node's features would be ignored when aggregating features for a patch. You can have a look at the original GCN paper (https://arxiv.org/pdf/1609.02907.pdf), especially eq. 7 for more details. The sparsity is not really a problem, it is a result of the specific problem at hand (and a design decision of the data set creators to some degree). Only the visualisation of the matrix is a bit tricky because it is large and mostly 0. |
Thanks for your kind reply! Maybe I have some misunderstanding on the mathematical principle of GCN and will go back to have a look. |
Here's how I created my own. It's not diagonal, but in list format: https://github.com/ThomasAFink/osmnx_adjacency_matrix_for_graph_convolutional_networks |
Hi,
I am confused with the Adjacency Matrix in your
adj_mat.npy
. It doesn't seem to be an adjacency matrix.Best
The text was updated successfully, but these errors were encountered: