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
Gradients do not exist for variables when applying learnable adjacency matrix to the GATConv layer #395
Comments
GAT computes the adjacency matrix as a function of the node features so there might be something unexpected going on there. Can you post a snippet to reproduce the issue? |
Snippet: x = x_origin # (batch_size, time_step, n_site, features) Epoch 1/80 Thank you for your reply! |
Yeah unfortunately GAT is not designed to work like that, there is no way to backpropagate the error to the dense layer that's generating the adjacency matrix. |
OK, I got it. |
Hi!
Recently I bulid learnable adjacency matrices for modeling in which case connections between different sites vary at different time steps. (Each time step corresponds to a specific graph structure). I used several fully connected layers (Dense) to make the initial adjacency matrices learnable, where parameters can be updated through model training, namely gradient descent. However, when applying the learnable adjacency matrices to the GATConv layer, Tensorflow Warnings appear as follows:
WARNING:tensorflow:Gradients do not exist for variables ['dense_2/kernel:0', 'dense_4/kernel:0', 'dense_3/kernel:0', 'dense_5/kernel:0'] when minimizing the loss.
WARNING:tensorflow:Gradients do not exist for variables ['dense_2/kernel:0', 'dense_4/kernel:0', 'dense_3/kernel:0', 'dense_5/kernel:0'] when minimizing the loss.
WARNING:tensorflow:Gradients do not exist for variables ['dense_2/kernel:0', 'dense_4/kernel:0', 'dense_3/kernel:0', 'dense_5/kernel:0'] when minimizing the loss.
WARNING:tensorflow:Gradients do not exist for variables ['dense_2/kernel:0', 'dense_4/kernel:0', 'dense_3/kernel:0', 'dense_5/kernel:0'] when minimizing the loss.
If I use the GCNConv layer rather than the GATConv layer, Warnings above disappeared.
I guess that the adjacency matrices didn't truly take part in the process of graph attention. Is that true?
How can I handle this problem (avoid these warnings) when using a GATConv layer?
Expect for your reply, thank you very much!
The text was updated successfully, but these errors were encountered: