Does Pytorch Geometric have a method for integrating the top K neighbors? #5019
Unanswered
michaelma01
asked this question in
Q&A
Replies: 2 comments
-
There does not exist such a functionality right now, sorry for that. There do exists plans though to add support for biased neighbor sampling which should cover this use-case as well. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I sse. Thank you @rusty1s. |
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.
-
Hello all PyTorch Geometric Team and @rusty1s,
I'm wondering whether the Pytorch Geometric has a method for extracting a partial graph based on the edge weight. Similar to NeighborSampler, for each node in a graph, I want to only integrate the information from its partial neighbor nodes when doing the message passing. However, unlike NeighborSampler, I don't want to randomly pick the specified number of nodes. Instead, I want to pick the top K neighbor nodes based on the edges' weights.
For example, say I have a node
nA
, and it has five neighbor nodesnB
,nC
,nD
,nE
,nF
. Their edge weights are separately 0.1, 0.2, 0.4, 0.5, 0.05. I want to only consider three of its neighbor nodes based on its weights. So when doing the message passing, I want the nodenA
to only integrate the information fromnC
,nD
andnE
because these three neighbor nodes have higher edge weight.Does the Pytorch Geometric have such a method? Or do you have any suggestions how to modify the existing methods to achieve this goal? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions