Replies: 1 comment
-
We don't have a functional interface for this, I'm sorry. However, I still feel that this can be easily achieved via standard modules: conv = GCNConv(...)
conv.weight = A + B
conv(x, edge_index)
...
grad(loss, B, ...) Let me know if this works for you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Now I need to assign certain weights, say A, to a GNN Conv, which is computed by A = B + C where B and C are matrices.
And I want to get the gradient of the Conv's output with respect to the weight matrix B. My current implementation is
But it did not work as the backpropagation fails when loading the state dict.
While PyTorch has implemented functional interface with weight input which can enable the backpropagation, i.e.,
Did PyTorch Geometric have provided such functions so that I can realize the requirement above.
Note it is similar to the question https://discuss.pytorch.org/t/assign-variable-to-model-parameter/6150
Beta Was this translation helpful? Give feedback.
All reactions