Get single Node feature instead of global pooling #4080
Answered
by
rusty1s
oliverluo1993
asked this question in
Q&A
-
Hi, I am trying to predict the node level instead of graph level properties. Except from global pooling layers to get graph level information. Is there a way to fetch a single node feature from batched node feature matrix? Best regards |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Feb 16, 2022
Replies: 1 comment 3 replies
-
You can use traditional indexing/ node_idx = torch.tensor([0, 10, 15]) # Select features of node 0, 10 and 15
out = x[node_idx] Does that answer your question? |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
oliverluo1993
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use traditional indexing/
index_select
to select specific node feature vectors, e.g.Does that answer your question?