MultiLayer Graph Attention Networks #92
-
I am wondering, how can i implement Multi-Layer GraphAttention, i try to implement it but i doubt if my code is already right or not?
Thank you My Multilayer GraphAttention
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I have another question Model1:
Model2
what is difference Model1 and Model2, do we have to always use batch size to declare number of matrix row? Can I get same result using Model1 with some adjustment? The architecture is from this paper https://openaccess.thecvf.com/content_CVPR_2019/papers/Chen_Multi-Label_Image_Recognition_With_Graph_Convolutional_Networks_CVPR_2019_paper.pdf Is possible to produce the architecture using Spektral as part of it? Thank you very much |
Beta Was this translation helpful? Give feedback.
-
Hi, The code to implement a multi-layer GAT is correct. You don't need to pass a different adjacency matrix because the graph structure (the edges) does not change after a GAT layer, but only the node attributes change. The adjacency matrix is not technically replaced by the attention, but you can see it as a re-scaling. Given an edge between two nodes, the adjacency matrix will give you a "weight" of 1, while the attention mechanism will rescale that 1 to account for how important that connection is. The two models that you posted are semantically different. The second model has input shapes Depending on how your data is structured, one model should work and the other should crash. Also note that if you don't specify the batch size in model 1, it is automatically set to 32 by Keras. Cheers |
Beta Was this translation helpful? Give feedback.
Hi,
The code to implement a multi-layer GAT is correct. You don't need to pass a different adjacency matrix because the graph structure (the edges) does not change after a GAT layer, but only the node attributes change.
The adjacency matrix is not technically replaced by the attention, but you can see it as a re-scaling. Given an edge between two nodes, the adjacency matrix will give you a "weight" of 1, while the attention mechanism will rescale that 1 to account for how important that connection is.
The two models that you posted are semantically different.
The
Input
layer in Keras assumes that there is an implicit batch size that you do not specify in theshape
keyword.So, your first …