Replies: 1 comment 2 replies
-
You should be able to only pass in a single node and its neighbors to edge_index = torch.tensor([[1, 2, 3, 4, 5], [0, 0, 0, 0, 0]]) # bipartite graph only pointing to node 0
x = ... # node feature matrix with shape [6, #features]
out_central = conv((x, x[:1]), edge_index)
# out_central has shape [1, #features] Let me know if this resolves your issues :) |
Beta Was this translation helpful? Give feedback.
2 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.
-
Hello, I would like to ask, how to update only one or part of the nodes in the graph in PyG's GAT. To be precise, I only need to get the attention weight of a node or some nodes (not all nodes) in the graph to its neighbors, I read the source code, that is, "torch_geometric.utils.softmax", the bottom layer uses operations such as torch.scatter_, but I still can't solve it.
If no such method exists, is there an efficient way to extract the attention weights of partial center nodes to their neighbors from all the attention weights (alpha: (num_edges, heads))?
Beta Was this translation helpful? Give feedback.
All reactions