Replies: 1 comment 1 reply
-
N = 3
row = torch.arange(N).view(-1, 1).repeat(1, N).view(-1)
col = torch.arange(N).view(-1, 1).repeat(N, 1).view(-1)
edge_index = torch.stack([row, col], dim=0) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fedeotto
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.
-
Hello, since I want to perform regression on a dataset made by several graphs with different nodes number that I want to be fully connected, I would like to know if there is some straightforward way to make
edge_index
fully connected for each of them.I have built a
torch.utils.data.Dataset
object and what I have is the followingand then a
DataLoader
So the first entry in my processed dataset is a graph made up by three nodes with 112 features (
[3,112]
) and a target ([1]
). Now , trying to run simple models, theedge_index
is required in theforward()
method and this is reasonable since the connectivity is used for message passing. But how could I specify edge_index in my case to make all the graphs fully connected?I think it would be the best if I could do it while creating
data_list
by something likedata_list = [Data(x=train, edge_index='fullyconnected', y=target) for train,target in dataset]
thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions