"vscode:/vscode.git/clone" did not exist on "2a9d995c09dd16c06e457664028c732d7f3bc16a"
README.md 1.61 KB
Newer Older
hbsun2113's avatar
hbsun2113 committed
1
2
3
4
Inductive Representation Learning on Large Graphs (GraphSAGE)
============

- Paper link: [http://papers.nips.cc/paper/6703-inductive-representation-learning-on-large-graphs.pdf](http://papers.nips.cc/paper/6703-inductive-representation-learning-on-large-graphs.pdf)
5
- Author's code repo: [https://github.com/williamleif/graphsage-simple](https://github.com/williamleif/graphsage-simple)
hbsun2113's avatar
hbsun2113 committed
6

7
For advanced usages, including training with multi-gpu/multi-node, and PyTorch Lightning, etc., more examples can be found in [advanced](https://github.com/dmlc/dgl/tree/master/examples/pytorch/graphsage/advanced) and [dist](https://github.com/dmlc/dgl/tree/master/examples/pytorch/graphsage/dist) directory.
8

hbsun2113's avatar
hbsun2113 committed
9
10
11
Requirements
------------

12
```bash
13
pip install requests torchmetrics
14
```
hbsun2113's avatar
hbsun2113 committed
15

16
How to run
hbsun2113's avatar
hbsun2113 committed
17
18
-------

19
20
### Full graph training

hbsun2113's avatar
hbsun2113 committed
21
22
Run with following (available dataset: "cora", "citeseer", "pubmed")
```bash
23
python3 train_full.py --dataset cora --gpu 0    # full graph
hbsun2113's avatar
hbsun2113 committed
24
25
```

26
27
Results:
```
28
29
30
* cora: ~0.8330 
* citeseer: ~0.7110
* pubmed: ~0.7830
31
```
32

33
### Minibatch training for node classification
34

35
Train w/ mini-batch sampling in mixed mode (CPU+GPU) for node classification on "ogbn-products"
36
37

```bash
38
python3 node_classification.py
39
40
```

41
42
43
44
45
Results:
```
Test Accuracy: 0.7632
```

46
47
48
49
50
51
52
53
54
### PyTorch Lightning for node classification

Train w/ mini-batch sampling for node classification with PyTorch Lightning on OGB-products.
Works with both single GPU and multiple GPUs:

```bash
python3 lightning/node_classification.py
```

55
### Minibatch training for link prediction
56

57
Train w/ mini-batch sampling for link prediction on OGB-Citation2:
58
59

```bash
60
python3 link_pred.py
61
```