'Difference between pooling and global pooling in torch_geometric.nn

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1