gammagl.layers.pool.global_sort_pool¶
- class global_sort_pool(x, batch, k)[source]¶
The global pooling operator from the “An End-to-End Deep Learning Architecture for Graph Classification” paper, where node features are sorted in descending order based on their last feature channel. The first \(k\) nodes form the output of the layer.
- Parameters:
x (tensor) – Node feature matrix \(\mathbf{X} \in \mathbb{R}^{N \times F}\).
batch (tensor) – Batch vector \(\mathbf{b} \in {\{ 0, \ldots, B-1\}}^N\), which assigns each node to a specific example.
k (int) – The number of nodes to hold for each graph.
- Return type:
Tensor