If I would like to train a GCN to classify nodes, should I set the final number of neurons to correspond to the number of possible labels, followed by a softmax function?
For making predictions on node labels, should I pass the graph to the network with masked labels and the compare the predictions to the ground truth?
Basically yes. To avoid potential confusion, let me clarify a bit more.
The general scenario is that we have few large graphs where only a subset of nodes have labels and we want to infer the labels of the rest nodes. For example, a new paper appears on ArXiv and we want to assign a tag to it. In a citation graph, the nodes stand for papers and the edges stand for citations. If we know that the papers got cited have tags like “machine learning” and “parallel computing”, then probably this new paper should have tags like “machine learning systems”.
The graph neural networks exploit the information of labeled nodes, node features and graph topology with an operation called message passing/graph convolution. Basically, they update the features of nodes based on the features of node neighbors. In the case of semi-supervised node classification, we first perform message passing/graph convolution over the whole graphs and then the objective function is computed only on a subset of nodes. That says:
- We assume all nodes have features, even for the unlabeled ones.
- The masked nodes are not involved directly for loss computation and we assume no access to their labels during training. However, their features get implicitly involved with message passing/graph convolution, similar to the scenario we are interested in.