Paper: Heterogeneous Graph Structure Learning for Graph Neural Networks
Code from author: https://github.com/Andy-Border/HGSL
Clone the Openhgnn-DGL
python main.py -m HGSL -d acm4GTN -t node_classification -g 0 --use_best_config
If you do not have gpu, set -gpu -1.
Node classification
Node classification | acm4GTN macro-f1 | acm4GTN micro-f1 |
---|---|---|
paper | 93.48 | 93.37 |
OpenHGNN | 93.28 | 93.18 |
The model is trained in semi-supervisied node classification.
- GraphGenerator
- Contain MetricCalcLayer.
- Generate a graph according to two feature matrices.
- MetricCalcLayer
- Calculate the metric.
- GraphChannelAttLayer
- Perform the channel attention operation on several similarity graphs.
- GCN
- Contain the GraphConvolution.
- The downstream GNN.
- GraphConvolution
- The graph convolution layer of GCN.
Supported dataset: acm4GTN
We process the acm4GTN dataset with adding the metapath2vec embeddings obtained from the dataset of the author's code.
Requirements for datasets
- The graph should be an undirected heterogeneous graph.
- Every node type in graph should have its feature named 'h' and the same feature dimension.
- Every node type in graph should have its metapath2vec embedding feature named 'xxx_m2v_emb' and the same feature dimension.
hidden_dim = 16
num_heads = 2
gnn_emd_dim = 64
The best config for each dataset can be found in best_config.
This model under the best config has some slight differences compared with the code given by the paper author,which seems having little impact on performance:
- The regularization item in loss is on all parameters of the model, while in the author's code, it is only on the generated adjacent matrix. If you want to implement the latter, a new task of OpenHGNN is needed.
- The normalization of input adjacent matrix is separately on different adjacent matrices of different relations, while in the author's code, it is on the entire adjacent matrix composed of adjacent matrices of all relations.
Xinlong Zhai[GAMMA LAB]
Submit an issue or email to zhaijojo@bupt.edu.cn.