Max Neighbour Pooling

Is a Max Pool Neighboring node features available already? Definition below

from pytorch-geometric: max_pool_neighbour_x
Max pools neighboring node features, where each feature in data.x is replaced by the feature value with the maximum value from the central node and its neighbors.

This pull request has the code available and further details: add neighbor max pooling by rhsimplex · Pull Request #1411 · rusty1s/pytorch_geometric · GitHub

I’m new to DGL - how can I implement this in DGL if it’s not readily available please?

The idea would be the apply the max_neighbour_pool after a GraphConv layer, and then pass the output to a GraphConv layer again, so it’s different to a global pooling layer or DGL readout.

One option is to add self loops first and then perform

import dgl.function as fn

g.update_all(fn.copy_u(...), fn.max())

For the documentation of the APIs, see update_all, fn.copy_u, and fn.max.

1 Like

Yes, this worked thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.