codeKgu/BiLevel-Graph-Neural-Network

User guide

dtchang opened this issue · 1 comments

Please provide a simple user guide that addresses configuration and extension, among other things that you deem important:

  1. Configuration
    It seems the code should work with GCNConv. If so, what changes should one make in config.py (which is set up for GATConv), and other places if needed, to use it for both the representation graphs and the interaction graph?
  2. Extension
    How can one add and use different types of Conv supported by PyTorch Geometric? Is extending layers.py and layers_meta.py sufficient?

Thanks.

I have updated config.py that points to the locations that you can make changes for different gnn methods that are supported and where to change it for the representation graph and the interaction graph.

In regards to using different types of Conv supported by PyTorch Geometric you can register the gnn conv in the NodeEmbedding module in layers.py and call it during the forward pass analogous to the current implementation for gcn, gat, and gin. Then change lower_level_gnn_type and/or higher_level_gnn_type in config.py to the name of your gnn conv.

For layers_meta when wanting to perform multi_edge_aggr with a custom gcn conv, register it in NodeModelAggrByEdge in layers_meta.py analogous to the current implementation for gcn and gat and change node_model in config.py.

If you want to incorporate edge attributes into your own conv, then you need to create a conv module that takes edge_attr as an argument during the forward pass. See GCNConvEdge or GATConvEdge in layers_meta.py. Register this module that takes edge attributes in NodeModelGNN and finally in MetaLayerWrapper. Similar to before you would also change node_model in config.py