Implementation of Learnable Aggregators for Graph Convolutional Networks in PyTorch.
Learnable Aggregator for GCN (LA-GCN) by introducing a shared auxiliary model that provides a customized schema in neighborhood aggregation. Under this framework, a new model proposed called LA-GCN(Mask) consisting of a new aggregator function, mask aggregator. The auxiliary model learns a specific mask for each neighbor of a given node, allowing both node-level and feature-level attention. This mechanism learns to assign different importance to both nodes and features for prediction, which provides interpretable explanations for prediction and increases the model robustness. [1]
Li Zhang ,Haiping Lu, A Feature-Importance-Aware and Robust Aggregator for GCN (CIKM 2020)
- PyTorch 1.8
- Python 3.8
python train.py
You can also try out in colab if you don't have any requirements!
Note: Since random inits, your training results may not exact the same as reported in the paper!
In order to use your own data, you have to provide
- an N by N adjacency matrix (N is the number of nodes),
- an N by D feature matrix (D is the number of features per node), and
- an N by E binary label matrix (E is the number of classes). [2]
Have a look at the load_data()
function in utils.py
for an example.
In this example, we load citation network data (Cora, Citeseer or Pubmed). The original datasets can be found here: http://www.cs.umd.edu/~sen/lbc-proj/LBC.html. In our version (see data
folder) we use dataset splits provided by https://github.com/kimiyoung/planetoid (Zhilin Yang, William W. Cohen, Ruslan Salakhutdinov, Revisiting Semi-Supervised Learning with Graph Embeddings, ICML 2016).
You can specify a dataset as follows:
- For Citeseer:
python train.py --dataset "citeseer"
- For Cora:
python train.py --dataset "cora"
- For Pubmed:
python train.py --dataset "pubmed"
[1] Zhang & Lu, A Feature-Importance-Aware and Robust Aggregator for GCN, CIKM 2020
[2] Kipf & Welling, Semi-Supervised Classification with Graph Convolutional Networks, 2016
@inproceedings{zhang2020feature,
title={A Feature-Importance-Aware and Robust Aggregator for GCN},
author={Zhang, Li and Lu, Haiping},
booktitle={Proceedings of the 29th ACM International Conference on Information \& Knowledge Management},
pages={1813--1822},
year={2020}
}
@article{kipf2016semi,
title={Semi-supervised classification with graph convolutional networks},
author={Kipf, Thomas N and Welling, Max},
journal={arXiv preprint arXiv:1609.02907},
year={2016}
}