This DGL example implements the graph embedding model proposed in the paper node2vec: Scalable Feature Learning for Networks
The author's codes of implementation is in Node2vec
This example was implemented by Smile during his intern work at the AWS Shanghai AI Lab.
cora
- NumNodes: 2708
- NumEdges: 10556
ogbn-products
- NumNodes: 2449029
- NumEdges: 61859140
- python 3.6+
- Pytorch 1.5.0+
- ogb
To train a node2vec model:
python main.py --task="train"
To time node2vec random walks:
python main.py --task="time" --runs=10
Setting: walk_length=50, p=0.25, q=4.0
Dataset | DGL | PyG |
---|---|---|
cora | 0.0092s | 0.0179s |
products | 66.22s | 77.65s |
Note that the number in table are the average results of multiple trials. | ||
For cora, we run 50 trials. For ogbn-products, we run 10 trials. |