"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "b7947c85bfdf77ef5636ec2943330aa09b1542e9"
README.md 1.71 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==0.11.4 ogb
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
* cora: ~0.8330
29
30
* 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
### PyTorch Lightning for node classification

48
Train w/ mini-batch sampling for node classification with PyTorch Lightning on OGB-products. It requires PyTorch Lightning 2.0.1. It works with both single GPU and multiple GPUs:
49
50
51
52
53

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

54
### Minibatch training for link prediction
55

56
Train w/ mini-batch sampling for link prediction on OGB-citation2:
57
58

```bash
59
python3 link_pred.py
60
```
61
62
63
64
65

Results (10 epochs):
```
Test MRR: 0.7386
```