I wonder how to use NeighborLoader correctly? #3409
Replies: 1 comment 2 replies
-
Yes, all your understandings are correct.
We deprecated |
Beta Was this translation helpful? Give feedback.
-
Yes, all your understandings are correct.
We deprecated |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I haven't learnt much about older version of NeighborSampler, just directly learnt NeighborLoader which is recommended.
And I find that each batch is a PyG.data.Data format graph, which seems that I can directly put one batch in a normal model which take
x,edge_index
as input. So is that the correct method to apply NeighborLoader?Besides, is factors of
num_neighbors
paramater means how many neighbors to sample in this hop? And all sampled nodes and sampled edges consist of the graph of the output batch? And thedirected
input parameter decides whether the batch data is a directed graph, thetransform
input parameter decides if the batch data will be transformed?I wonder what the
replace
input parameter decides, if it's false, it won't sample the same neighbor twice or more? So if it's true, will the batch data has edge weight?And I've seen the example code for NeighborSampler in https://github.com/pyg-team/pytorch_geometric/blob/master/examples/reddit.py. It seems that the output batch was as many hops as many bipartite graphs sampled. And the code seems more complex, in training time it should use bipartite graphs to train mini-batches, in testing time it should collect node embeddings in all mini-batches for all layers, am I correct? I haven't understood it totally.
I'm changing a code in older version used NeighborSampler to a newer version. If my understanding is correct, I think it's much easier for me to use NeighborLoader than NeighborSampler. I can use it just like implementing full-batch GNN.
Beta Was this translation helpful? Give feedback.
All reactions