3

I realised that torch_geometric library offers both global pooling layers and pooling layers, but I don't really understand what is the difference between these 2 when applied to Graph Neural Networks?

tangolin
  • 434
  • 5
  • 15

1 Answers1

4

The difference is how the pooling is performed.

Global pooling gives you one supernode that contains the aggregated features from the whole graph.

Local pooling operation on the other hand create clusters and aggregates nodes in them.

Among local pooling you can find for instance Top-K pooling algorithm, SAGPool etc. They both have parameter called "ratio" that lets you specify how many nodes should be removed. Local pooling can give you a bit of hierarchical approach.

BraveDistribution
  • 445
  • 1
  • 4
  • 18
  • Could you explain, how we get from local pooling to one global vector that represents the entire graph? Also: Assume, I have node vector with 64 features. What I don't quite get is this: During aggregation, a graph vector of the same dimensions as the node vector is produced. Assume a graph has 100 nodes or more. Then compressing 100 nodes into 1 64 element vector seems rather lossy. But then again if we want to learn from graphs of varying sizes because they represent proteins or molecules, are there better ways to do this? – Thornhale Feb 05 '23 at 04:44