79491539

Date: 2025-03-07 07:38:38
Score: 0.5
Natty:
Report link

Of course you are having troubles with indices mismatch between node feature matrix and the edge_index.

The edge index must be a tensor with shape (2, number_of_edges) and with values < num_nodes.
Each column of the edge index represent and edge and it is used to access the matrix of node features through the convolution process.

Probably, in the program you are running, you have 1000 nodes, and you didn't aligned edge indices correctly because you removed node features without updating the edge index or added nodes to the edge index without updating the node features.

It is very important that indices of edge index are aligned and consistent with node features, if not, you must add an offset to node features or normalize edge indices depending on what is your issue:

I usually do something like this on dim 0 or 1 to normalize src or dst of the edge index:

_, edge_index[0] = torch.unique(edge_index[0], return_inverse=True)
Reasons:
  • Blacklisted phrase (1): what is your
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: daqh