How to mask nodes in PyTorch Geometric for a particular layer?

287 Views Asked by At

I am working on a node classification problem, and I have a graph where some nodes do not have features, and each of these nodes are connected to several nodes with features.

I want to aggregate the features from the nodes with features to the nodes without features but only on particular layers of my GNN. I know the nodes with and without features beforehand. Is there a mechanism for doing this in PyTorch Geometric? e.g., mask a subset of nodes/edges but only for specific layers and for predefined nodes?

I am somewhat new to GNNs. This seems straightforward, but I am not sure how to implement this in pytorch geometric. Right now, I am simply doing the aggregation for the nodes before loading the data into pytorch, but this seems more appropriate implementing as a layer or pretransform.

0

There are 0 best solutions below