Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
0ec43924
Unverified
Commit
0ec43924
authored
Mar 01, 2022
by
Rhett Ying
Committed by
GitHub
Mar 01, 2022
Browse files
[Examples] re-locate load_graph for share (#3784)
parent
e0f0fa2a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
10 deletions
+16
-10
examples/pytorch/graphsage/advanced/train_lightning.py
examples/pytorch/graphsage/advanced/train_lightning.py
+2
-1
examples/pytorch/graphsage/advanced/train_lightning_unsupervised.py
...ytorch/graphsage/advanced/train_lightning_unsupervised.py
+2
-1
examples/pytorch/graphsage/advanced/train_sampling_unsupervised.py
...pytorch/graphsage/advanced/train_sampling_unsupervised.py
+2
-0
examples/pytorch/graphsage/dist/README.md
examples/pytorch/graphsage/dist/README.md
+7
-7
examples/pytorch/graphsage/dist/partition_graph.py
examples/pytorch/graphsage/dist/partition_graph.py
+2
-1
examples/pytorch/graphsage/distgnn/partition_graph.py
examples/pytorch/graphsage/distgnn/partition_graph.py
+1
-0
examples/pytorch/graphsage/load_graph.py
examples/pytorch/graphsage/load_graph.py
+0
-0
No files found.
examples/pytorch/graphsage/advanced/train_lightning.py
View file @
0ec43924
...
@@ -10,7 +10,8 @@ import argparse
...
@@ -10,7 +10,8 @@ import argparse
import
tqdm
import
tqdm
import
glob
import
glob
import
os
import
os
import
sys
sys
.
path
.
append
(
'../'
)
from
load_graph
import
load_reddit
,
inductive_split
,
load_ogb
from
load_graph
import
load_reddit
,
inductive_split
,
load_ogb
from
torchmetrics
import
Accuracy
from
torchmetrics
import
Accuracy
...
...
examples/pytorch/graphsage/advanced/train_lightning_unsupervised.py
View file @
0ec43924
...
@@ -14,10 +14,11 @@ import os
...
@@ -14,10 +14,11 @@ import os
from
negative_sampler
import
NegativeSampler
from
negative_sampler
import
NegativeSampler
from
pytorch_lightning.metrics
import
Accuracy
from
pytorch_lightning.callbacks
import
ModelCheckpoint
,
Callback
from
pytorch_lightning.callbacks
import
ModelCheckpoint
,
Callback
from
pytorch_lightning
import
LightningDataModule
,
LightningModule
,
Trainer
from
pytorch_lightning
import
LightningDataModule
,
LightningModule
,
Trainer
from
model
import
SAGE
,
compute_acc_unsupervised
as
compute_acc
from
model
import
SAGE
,
compute_acc_unsupervised
as
compute_acc
import
sys
sys
.
path
.
append
(
'../'
)
from
load_graph
import
load_reddit
,
inductive_split
,
load_ogb
from
load_graph
import
load_reddit
,
inductive_split
,
load_ogb
class
CrossEntropyLoss
(
nn
.
Module
):
class
CrossEntropyLoss
(
nn
.
Module
):
...
...
examples/pytorch/graphsage/advanced/train_sampling_unsupervised.py
View file @
0ec43924
...
@@ -14,6 +14,8 @@ from torch.nn.parallel import DistributedDataParallel
...
@@ -14,6 +14,8 @@ from torch.nn.parallel import DistributedDataParallel
from
model
import
SAGE
,
compute_acc_unsupervised
as
compute_acc
from
model
import
SAGE
,
compute_acc_unsupervised
as
compute_acc
from
negative_sampler
import
NegativeSampler
from
negative_sampler
import
NegativeSampler
import
sys
sys
.
path
.
append
(
'../'
)
from
load_graph
import
load_reddit
,
load_ogb
from
load_graph
import
load_reddit
,
load_ogb
class
CrossEntropyLoss
(
nn
.
Module
):
class
CrossEntropyLoss
(
nn
.
Module
):
...
...
examples/pytorch/graphsage/dist/README.md
View file @
0ec43924
...
@@ -116,7 +116,7 @@ The command below launches one process per machine for both sampling and trainin
...
@@ -116,7 +116,7 @@ The command below launches one process per machine for both sampling and trainin
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
\
python3 ~/workspace/dgl/tools/launch.py
\
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
1
\
--num_trainers
1
\
--num_samplers
0
\
--num_samplers
0
\
--num_servers
1
\
--num_servers
1
\
...
@@ -129,7 +129,7 @@ To run unsupervised training:
...
@@ -129,7 +129,7 @@ To run unsupervised training:
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
\
python3 ~/workspace/dgl/tools/launch.py
\
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
1
\
--num_trainers
1
\
--num_samplers
0
\
--num_samplers
0
\
--num_servers
1
\
--num_servers
1
\
...
@@ -143,7 +143,7 @@ By default, this code will run on CPU. If you have GPU support, you can just add
...
@@ -143,7 +143,7 @@ By default, this code will run on CPU. If you have GPU support, you can just add
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
\
python3 ~/workspace/dgl/tools/launch.py
\
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
4
\
--num_trainers
4
\
--num_samplers
0
\
--num_samplers
0
\
--num_servers
1
\
--num_servers
1
\
...
@@ -154,7 +154,7 @@ python3 ~/workspace/dgl/tools/launch.py \
...
@@ -154,7 +154,7 @@ python3 ~/workspace/dgl/tools/launch.py \
To run supervised with transductive setting (nodes are initialized with node embedding)
To run supervised with transductive setting (nodes are initialized with node embedding)
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
4
\
--num_trainers
4
\
--num_samplers
4
\
--num_samplers
4
\
--num_servers
1
\
--num_servers
1
\
...
@@ -166,7 +166,7 @@ python3 ~/workspace/dgl/tools/launch.py --workspace ~/workspace/dgl/examples/pyt
...
@@ -166,7 +166,7 @@ python3 ~/workspace/dgl/tools/launch.py --workspace ~/workspace/dgl/examples/pyt
To run supervised with transductive setting using dgl distributed DistEmbedding
To run supervised with transductive setting using dgl distributed DistEmbedding
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
4
\
--num_trainers
4
\
--num_samplers
4
\
--num_samplers
4
\
--num_servers
1
\
--num_servers
1
\
...
@@ -178,7 +178,7 @@ python3 ~/workspace/dgl/tools/launch.py --workspace ~/workspace/dgl/examples/pyt
...
@@ -178,7 +178,7 @@ python3 ~/workspace/dgl/tools/launch.py --workspace ~/workspace/dgl/examples/pyt
To run unsupervised with transductive setting (nodes are initialized with node embedding)
To run unsupervised with transductive setting (nodes are initialized with node embedding)
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
4
\
--num_trainers
4
\
--num_samplers
0
\
--num_samplers
0
\
--num_servers
1
\
--num_servers
1
\
...
@@ -190,7 +190,7 @@ python3 ~/workspace/dgl/tools/launch.py --workspace ~/workspace/dgl/examples/pyt
...
@@ -190,7 +190,7 @@ python3 ~/workspace/dgl/tools/launch.py --workspace ~/workspace/dgl/examples/pyt
To run unsupervised with transductive setting using dgl distributed DistEmbedding
To run unsupervised with transductive setting using dgl distributed DistEmbedding
```
bash
```
bash
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
experimental
/
\
python3 ~/workspace/dgl/tools/launch.py
--workspace
~/workspace/dgl/examples/pytorch/graphsage/
dist
/
\
--num_trainers
4
\
--num_trainers
4
\
--num_samplers
0
\
--num_samplers
0
\
--num_servers
1
\
--num_servers
1
\
...
...
examples/pytorch/graphsage/dist/partition_graph.py
View file @
0ec43924
...
@@ -3,7 +3,8 @@ import numpy as np
...
@@ -3,7 +3,8 @@ import numpy as np
import
torch
as
th
import
torch
as
th
import
argparse
import
argparse
import
time
import
time
import
sys
sys
.
path
.
append
(
'../'
)
from
load_graph
import
load_reddit
,
load_ogb
from
load_graph
import
load_reddit
,
load_ogb
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
examples/pytorch/graphsage/distgnn/partition_graph.py
View file @
0ec43924
...
@@ -19,6 +19,7 @@ from statistics import mean
...
@@ -19,6 +19,7 @@ from statistics import mean
import
random
import
random
import
time
import
time
import
argparse
import
argparse
sys
.
path
.
append
(
'../'
)
from
load_graph
import
load_ogb
from
load_graph
import
load_ogb
import
dgl
import
dgl
from
dgl.data
import
load_data
from
dgl.data
import
load_data
...
...
examples/pytorch/graphsage/
advanced/
load_graph.py
→
examples/pytorch/graphsage/load_graph.py
View file @
0ec43924
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment