This is the Group Work for Machine Learning Course.
- The model extend the original graph attention mechanism in GAT by including edge type information into attention calculation.
- At each layer, we calculate the coefficient:
- Residual connection including Node residual
$$ h_i^{(l)} = \sigma(\Sigma_{j\in \mathcal{N}i} {\alpha{ij}^{(l)}W^{(l)}h_j^{(l-1)}} + h_i^{(l-1)}) $$
-
where
$h_i$ and$h_j$ is the features of the source and the target node.$r_{\psi(e)}$ is a$d$ -dimension embedding for each edge type$\psi(e) \in T_e$ . -
and Edge residual:
- Finally, a multi-head attention is used.
author | paper | Subject | Paper-Author | Paper-Subject | Features | Train | Val | Test | |
---|---|---|---|---|---|---|---|---|---|
acm4GTN | 5,912 | 3,025 | 57 | 9,936 | 3,025 | 1,902 | 600 | 300 | 2,125 |
author | conference | paper | author-paper | conference-paper | Features | Train | Val | Test | |
---|---|---|---|---|---|---|---|---|---|
dblp4GTN | 4057 | 20 | 14328 | 19645 | 14328 | 334 | 800 | 400 | 2857 |
acm4GTN | dblp4GTN | |||
Model | valid | test | valid | test |
GTN(paper) | - | 92.68 | - | 94.18 |
RGCN | 95.67 | 95.15 | 94.50 | 93.91 |
SimpleHGN | 98.67 | 98.21 | 95.75 | 95.90 |
- Python >= 3.6
- Pytorch >= 1.9.0
- DGL >= 0.8.0
python trainer.py --model SimpleHGN --dataset acm4GTN --n_epoch 200 --num_heads 4 --in_dim 256 --edge_dim 64 --hidden_dim 128 --out_dim 64 --num_layers 2 --feat_drop 0.2 --negative_slope 0.2 --beta 0.2 --clip 1.0 --max_lr 1e-3