-
I have a heteregenous graph that contains multiple node and edge types. I used two different methods to create the node indices and the edge lists.
Method 2:
The primary distinction between these methods is in the initialization of node indices. In Method 1, I ensure sequential indexing for each node type to prevent index overlap. I assume this is the conventional way of creating node indices and that the second method should not be used since it will invetibaly have the same indice value for different node types which will result in a wrong conception of the graph. (correct me if I'm wrong) However, I've encountered an error. The error message is displayed below:
If my understanding is correct, the interval [0, 2757] corresponds to the number of tweets in the dataset, and the interval [2128, 4885] . is interpreted as follows [number of users, number of users + number of tweets]. Which is illustrated through the code below:
My question and the confusion I have is around why does torch geometric range depend on the first index range it encounters and not the overall range AKA the sum of counts of all node types[tweet + user + lemma + root + word]. In the error message I got it should know that tweets indices range is between [2128, 4885] . How can I correctly index multiple node types and accurately construct their edge index lists? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The second method is correct. Each node type has its indices range from |
Beta Was this translation helpful? Give feedback.
The second method is correct. Each node type has its indices range from
[0, num_nodes - 1]
, so that we can efficiently fetch its feature vectors from it.