-
Hello, I am fairly new to graph neural networks and I am training a model using GAT and I have a few questions. My model input is such that each node correspond to an object coming from the data. I am calling the function by The question is my node count and edge_index size differs in each batch such that in the first batch I have:
In the second batch I have:
My question is can pytorch_geometric GAT implementation can handle this and having different edge_index and node size for each batch cause a problem for the model? Should I try to pad the graph in order to have same amount of attention_weights? If this is expected and not problematic how should pytorch_geometric handle different size of nodes and edge_index? Please guide me any help is greatly appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
PyG automatically handles different sizes of nodes and edges. You don't have to worry about that. Each GNN layer performs node-wise aggregation from its direct neighbors, which is independent of the actual node dimension. In particular, the node dimension can be seen as the "batch" dimension. |
Beta Was this translation helpful? Give feedback.
-
Okay thanks for the reply :) |
Beta Was this translation helpful? Give feedback.
PyG automatically handles different sizes of nodes and edges. You don't have to worry about that. Each GNN layer performs node-wise aggregation from its direct neighbors, which is independent of the actual node dimension. In particular, the node dimension can be seen as the "batch" dimension.