2
$\begingroup$

I'm training a Graph Convolutional Neural Network to output embeddings for nodes that I eventually want to perform classification on. I am a little confused on how the training, validation, and testing split works. I understand that I don't want the model to see the validation or test nodes during training, however can they still be a part of the graph during training(meaning my GCNN can still perform computation of validation nodes in the earlier layers but no embedding will be created for validation nodes). Or, should I completely remove validation and testing nodes from the graph, essentially creating a subgraph, and then train on that. Likewise for when performing validation should I just create a subgraph with all the validation nodes and then just compute those separately.

Overall, my question is when training/validating do we still do it over the entire graph, but the end embeddings that we compute correspond to what the train set and validation set are, or do I create completely separate graphs, one with all the training nodes and one with all the validation nodes.

$\endgroup$

1 Answer 1

1
$\begingroup$

There are two main settings of doing training/validation/testing in graphs:

  1. Inductive Setting: You datasets consists of multiple graph (e.g. molecules) and you simply split the graphs into training/validation/testing sets as you would do with multiple images

  2. Transductive Setting (Your case): You only have a single graph (e.g. a social network or a citation network like the CORA benchmark) and want to regress or classify the nodes. Here you select three disjoint subsets of nodes for training/validation/testing, respectively. In training you provide the training signal of nodes from the training subset only. Meaning you compute the loss only for the training nodes, thereby validation and testing nodes where never explicitly trained, but the models ability to predict them emerges from seeing similar neighborhoods during training.

Some additional remarks on the transductive setting: A good intuition to have on nodes in a graph is that they are not only defined by their node feature vectors but also by their multi-hop neighborhood, i.e. the role that they play in the graph. Taking away nodes for validation or masking their features in any way would effect the training set as well, because of the disturbance of surrounding neighborhoods. Essentially, we are not really performing node classification but neighborhood classification with graph neural networks. Therefore one can neither cut out nodes nor mask their features.

I understand that I don't want the model to see the validation or test nodes during training

Usually you are right, but for the graph case there is the exception which is the transductive setting. While the model does 'see' the validation nodes in training, it never 'sees' their labels and is thus never explicitly trained to predict them. Usually while working in this transductive setting, one tries to make the training set relatively small, usually below 50% of nodes in the graph but that depends on the dataset.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .