pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
20.54k stars 3.57k forks source link

GraphSAGE sampling operation #9328

Open 1234238 opened 1 month ago

1234238 commented 1 month ago

📚 Describe the documentation issue

Hello, I recently tried adding some nodes to a graph to observe changes in the original nodes, such as from A to B, where A is the inserted node. I want to see the changes in B, but I found that using GraphSAGE, the output of node B does not change. I also couldn't find the controls for the sampling operation in GraphSAGE. Could you explain which part controls the node sampling operation in GraphSAGE?

Suggest a potential alternative/fix

No response

rusty1s commented 1 month ago

The GraphSAGE model is separated into a sampling module (see NeighborLoader), and the corresponding GNN layer (see SAGEConv). Any sampling arguments can be controlled at the NeighborLoader level.