MEGA: Multi-Encoder GNN Architecture for stronger task collaboration and generalization accepted to PKDD 2024
This repository contains the code for our work "MEGA: Multi-Encoder GNN Architecture for stronger task collaboration and generalization" accepted to PKDD 2024. The code is based on the PyTorch Geometric library and is used to produce the experiment results of the paper. The code is organized as follows:
- Install the required packages:
* DGL 0.9.0
* PyTorch 1.12.0
* ogb 1.3.4
- Generate datasets with these scripts:
python hetero_graph_gen.py
python link_gen.py
- Pretrain models on all datasets, for both link and node tasks (You can also modify the script to run a selection of experiments):
cd scripts
bash universal_script.sh
- Evaluate pre-trained models on all datasets for node tasks (i.e., node classification and partition classification):
python downstream_node_classification.py
You can modify the contents of downstream_experiments/experiments/common_settings_ssnc.yaml
to change experimental setup.
- Evaluate pre-trained models on all datasets for link tasks (i.e., link prediction):
python downstream_link_prediction.py
You can modify the contents of downstream_experiments/experiments/common_settings_link.yaml
to change experimental setup.
- For ablations, you can pretrain models using the following script:
cd scripts
ssnc_chameleon_ablations.sh
- To review and aggregate the results, you can use the following notebook:
results_analysis.ipynb