Classifying graphs using GIN
We could directly implement a GIN model for node classification, but this architecture is more interesting for performing graph classification. In this section, we will see how to transform node embeddings into graph embeddings using global pooling techniques. We will then apply these techniques to the PROTEINS
dataset and compare our results using GIN and GCN models.
Graph classification
Graph classification is based on the node embeddings that a GNN produces. This operation is often called global pooling or graph-level readout. There are three simple ways of implementing it:
- Mean global pooling: The graph embedding is obtained by averaging the embeddings of every node in the graph:
- Max global pooling: The graph embedding is obtained by selecting the highest value for each node dimension:
- Sum global pooling: The graph embedding is obtained by summing the embeddings of every node in the graph...