How to set label and features for unlabeled node? #4727
Unanswered
JiaruiWang
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Are your labels input to your prediction? If so you might find the approach in https://github.com/pyg-team/pytorch_geometric/blob/master/torch_geometric/nn/models/mask_label.py useful. If they are not input maybe you should just mask these nodes while computing loss? |
Beta Was this translation helpful? Give feedback.
3 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.
-
My task is a node classification problem. The nodes in the graph are 40% labeled, and 60% unlabeled. 50 label classes. The label element in the Y tensor are 0~49 for regular classes, and -1 for unlabeled nodes conventionally.
I am using the
GCNconv
layer withadd_self_loops=False
. The node features are the one-hot vectors for its label. There will be unlabeled nodes in the computation graph during training. I am not sure how to set the features for these unlabeled nodes since their class label is -1. I am thinking about two ways:Which way is correct? Is there another better way?
Beta Was this translation helpful? Give feedback.
All reactions