All models

ClusterPooling

Graph pooling that scores edges, merges connected components above a threshold and sums their features.

Graphs and geometry · 159 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (12 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
257
Operations
159
Framework
PyTorch
Recurrent
No
Published
MLG workshop at ECML PKDD 2024
Cited by
1 (as of 18 October 2026)
Authors
T. Snelleman, B.M. Renting, H.H. Hoos, J.N. van Rijn
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m365
Graph hash
96dc44b3e40cb5cb2f9721d1a0b4b7381c39ce7bf7b01dddb1c4ca50834ec321
Skeleton hash
75556bdd08f5c1cb74ab5a94484657ada6c01d2e62911b53f1967ac0c7f7eb87
Architecture hash
ad3ee945382797b67c83ad82bc748583ab7a0b92844b91d2a5aa9726fa0b82a7
Diagram SHA-256
befb70cc4846e05a39317b3d25ea028607f05679c0074155f50774298dcbc1ff
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

torch_geometric.nn.pool.ClusterPooling(in_channels=128, edge_score_method='tanh')

What it is

ClusterPooling is a graph pooling operator that merges nodes so as not to cause data loss, while staying conceptually simple and computationally inexpensive. The paper names it edge-based graph component pooling and presents it as an improved version of edge contraction pooling. The motivation is a gap in the pooling landscape: operators that remove nodes cause data loss, and operators that merge nodes are often computationally expensive.

The layer computes a score for each edge by passing the concatenated features of the two endpoint nodes through a linear layer with a bias term, then an activation function. Edges whose score exceeds a user-configurable threshold are selected for merging. Clusters are then found as weakly connected components over the selected edges, via an algorithm introduced by Tarjan and implemented in Scipy. Based on the selected edges, graph clusters are calculated and compressed to one node using an injective sum aggregation. Weighted sums combine the features of the merged nodes to prevent information loss. The layer also keeps track of how nodes were combined, so the pooling step can be reverted for node-based tasks.

Two hard constraints of edge contraction pooling are removed: that always half the nodes are merged, and that nodes can only be merged with one neighbour. The flip side is that nothing guarantees how much, if at all, the graph shrinks. Worst-case time complexity is quadratic in the number of nodes. On four popular benchmarks it performs statistically significantly better than edge pool while cutting trainable parameters by 70.6% on average.

In the paper's experiments the activation was the hyperbolic tangent and the threshold was set to 0. In PyTorch Geometric the edge score method defaults to tanh. The authors' repository notes the layer was intended to be submitted to the PyTorch Geometric library separately after acceptance.

Key idea. Edge-based graph component pooling merges nodes so as not to cause data loss while staying conceptually simple and computationally inexpensive. It removes the hard constraints of edge contraction pooling where always half the nodes are merged and nodes can only be merged with one neighbour.

  • ClusterPooling
  • cluster pooling
  • Edge-Based Graph Component Pooling
  • graph component pooling
  • edge contraction pooling
  • edge pool
  • graph pooling
  • graph coarsening
  • graph classification
  • connected components
  • PyTorch Geometric
  • torch_geometric

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{snelleman2024edgebasedgraphcomponentpooling,
      title={Edge-Based Graph Component Pooling}, 
      author={T. Snelleman and B. M. Renting and H. H. Hoos and J. N. van Rijn},
      year={2024},
      eprint={2409.11856},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2409.11856}, 
}