Replies: 1 comment 1 reply
-
How about you use PyG def add_edge(data):
loop = torch.tensor([[0], [data.num_nodes - 1]])
data.edge_index = torch.cat([data.edge_index, loop], dim=1)
return data
dataset = Dataset(…, transform=add_edge) |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi, Thank you very much for your time in reading my question . newbie here sorry if I'm not making sense
if I have a bunch of directed graphs with varying number of nodes and edges, and individually I create some subgraphs and want edge feature in this case [0,3] to be concat of the edges in between its start and end and pass through a nn.Linear() layer, if the number of nodes and edges vary from cases to cases, some are five, some are ten or any number etc. how should I approach, by padding them all to the same size ? , or engineers using graphs dont do things like this ?
Thank you very much for your time in reading my question.
Beta Was this translation helpful? Give feedback.
All reactions