"tests/vscode:/vscode.git/clone" did not exist on "5c046ccab201bc921c24a5886ce0b5146fbf7d51"
README.md 1.86 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# HardGAT
## DGL Implementation of h/cGAO paper.

This DGL example implements the GNN model proposed in the paper [HardGraphAttention](https://arxiv.org/abs/1907.04652.pdf). 

HardGANet implementor
----------------------
This example was implemented by [Ericcsr](https://github.com/Ericcsr) during his Internship work at the AWS Shanghai AI Lab.

The graph dataset used in this example 
---------------------------------------
The DGL's built-in CoraGraphDataset. Dataset summary:
- NumNodes: 2708
- NumEdges: 10556
- NumFeats: 1433
- NumClasses: 7
- NumTrainingSamples: 140
- NumValidationSamples: 500
- NumTestSamples: 1000

The DGL's build-in CiteseerGraphDataset. Dataset Summary:

- NumNodes: 3327
- NumEdges: 9228
- NumFeats: 3703
- NumClasses: 6
- NumTrainingSamples: 120
- NumValidationSamples: 500
- NumTestSamples: 1000

The DGL's build-in PubmedGraphDataset. Dataset Summary:

- NumNodes: 19717
- NumEdges: 88651
- NumFeats: 500
- NumClasses: 3
- NumTrainingSamples: 60
- NumValidationSamples: 500
- NumTestSamples: 1000

How to run example files
--------------------------------
In the hgao folder, run

**Please use `train.py`**


```python
python train.py --dataset=cora
```

If want to use a GPU, run

```python
python train.py --gpu 0 --dataset=citeseer
```

If you want to use more Graph Hard Attention Modules

```python
python train.py --num-layers <your number> --dataset=pubmed
```

If you want to change the hard attention threshold k

```python
python train.py --k <your number> --dataset=cora
```

If you want to test with vanillia GAT

```python
python train.py --model <gat/hgat> --dataset=cora
```



Performance
-------------------------
| Models/Datasets | Cora | Citeseer | Pubmed |
| :-------------- | :--: | :------: | -----: |
| GAT in DGL | 81.5% | 70.1% | 77.7% |
| HardGAT | 81.8% | 70.2% |78.0%|

Notice that HardGAT Simply replace GATConv with hGAO mentioned in paper.