Replies: 1 comment
-
One way to do this might be to add a variable that indicates original node id, as described here #3528, and then search for that node id in the neighbor loaders output. Although this might be slow. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I'm interested in using NeighborLoader to lower the complexity of a forward pass of the dataset in GNN and get node embeddings. However, wanted to know can I index the embedding of a node of concern after the sampler samples a batch? If I'm interested in a particular node embedding, I can retrieve its node embedding if i use the original dataset, by indexing the corresponding idx- but when i utilize the data sampler, how would i index the embedding of the same node?
Lets say I'm using the OGB_mag dataset. This is the data:
I'm interested getting the node embeddings of
paper
for paper 10, 11. To do this, I'd just retrieve the 10th and 11th index in the paper output ofmodel(data.x_dict, data.edge_index_dict)
. However, if I utilize theNeighborLoader
, (and ensure the 10th and 11th index are part of the mask), I might get x of size: x=[20839, 128]. Now, how would I get the embedding of paper 10 and paper 11? Indexing 10 and 11 in the minibatch does not lead me to the 10th and 11th paper of interest originally.Any suggestions on what can be done?
Beta Was this translation helpful? Give feedback.
All reactions