Can I put the edges' weights into the edge_attr?
See original GitHub issue❓ Questions & Help
Hi, first of all, thank you so much for this wonderful tool for PyTorch. I am a newbie in this library so I have two very strange questions.
1. edge_attr
I notice that the Data
class has an attribution named edge_attr
which holds the edges’ features in the graph.
And currently, I need to construct a weighted directed graph Data
instance for GCNConv
.
So here is my question: Can I put the weight into the edge_attr
for creating the Data
instance?
In my view, I think it is just okay, but seems so strange. Because in this time the shape of the edge_attr
tensor is actually [num_edges, 1]
.
So, is it okay to do it?
2. Dynamical batch
I also want to confirm one thing.
Here FAQ2, your introduction seems to show that I can dynamically construct a graph DataLoader
in this way:
from torch_geometric.data import Data, DataLoader
data_list = [Data(...), ..., Data(...)]
loader = DataLoader(data_list, batch_size=32)
Is that all I need to do? Don’t I need to do some stuff like padding for the batches?
Finally, thank you so much for your work and hope you to respond to my questions.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hello, author. Can you explain the principle of “Weighted GCN layer”, thanks!
Please have a look at the GATConv layer in torch_geometric.nn.