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
2ff8ecfb
Unverified
Commit
2ff8ecfb
authored
Apr 25, 2019
by
Chao Ma
Committed by
GitHub
Apr 25, 2019
Browse files
update test_batch_size (#510)
parent
ca48787a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
examples/mxnet/sampling/dis_sampling/gcn_trainer.py
examples/mxnet/sampling/dis_sampling/gcn_trainer.py
+4
-1
examples/mxnet/sampling/dis_sampling/run_sampler.sh
examples/mxnet/sampling/dis_sampling/run_sampler.sh
+1
-1
examples/mxnet/sampling/dis_sampling/run_trainer.sh
examples/mxnet/sampling/dis_sampling/run_trainer.sh
+1
-1
No files found.
examples/mxnet/sampling/dis_sampling/gcn_trainer.py
View file @
2ff8ecfb
...
@@ -194,7 +194,7 @@ def main(args):
...
@@ -194,7 +194,7 @@ def main(args):
for
epoch
in
range
(
args
.
n_epochs
):
for
epoch
in
range
(
args
.
n_epochs
):
idx
=
0
idx
=
0
for
nf
in
sampler
:
for
nf
in
sampler
:
print
(
"epoch: %d, subgraph: %d"
%
(
epoch
,
idx
))
print
(
"
Train
epoch: %d, subgraph: %d"
%
(
epoch
,
idx
))
idx
+=
1
idx
+=
1
nf
.
copy_from_parent
()
nf
.
copy_from_parent
()
# forward
# forward
...
@@ -216,11 +216,14 @@ def main(args):
...
@@ -216,11 +216,14 @@ def main(args):
num_acc
=
0.
num_acc
=
0.
idx
=
0
for
nf
in
dgl
.
contrib
.
sampling
.
NeighborSampler
(
g
,
args
.
test_batch_size
,
for
nf
in
dgl
.
contrib
.
sampling
.
NeighborSampler
(
g
,
args
.
test_batch_size
,
g
.
number_of_nodes
(),
g
.
number_of_nodes
(),
neighbor_type
=
'in'
,
neighbor_type
=
'in'
,
num_hops
=
args
.
n_layers
+
1
,
num_hops
=
args
.
n_layers
+
1
,
seed_nodes
=
test_nid
):
seed_nodes
=
test_nid
):
print
(
"Test epoch: %d, subgraph: %d"
%
(
epoch
,
idx
))
idx
+=
1
nf
.
copy_from_parent
()
nf
.
copy_from_parent
()
pred
=
infer_model
(
nf
)
pred
=
infer_model
(
nf
)
batch_nids
=
nf
.
layer_parent_nid
(
-
1
).
astype
(
'int64'
).
as_in_context
(
ctx
)
batch_nids
=
nf
.
layer_parent_nid
(
-
1
).
astype
(
'int64'
).
as_in_context
(
ctx
)
...
...
examples/mxnet/sampling/dis_sampling/run_sampler.sh
View file @
2ff8ecfb
DGLBACKEND
=
mxnet python3 gcn_ns_sampler.py
--ip
127.0.0.1:2049
--num-sender
=
1
--dataset
reddit-self-loop
--num-neighbors
2
--batch-size
1000
--test-batch-size
500
DGLBACKEND
=
mxnet python3 gcn_ns_sampler.py
--ip
127.0.0.1:2049
--num-sender
=
1
--dataset
reddit-self-loop
--num-neighbors
3
--batch-size
1000
--test-batch-size
500
0
examples/mxnet/sampling/dis_sampling/run_trainer.sh
View file @
2ff8ecfb
DGLBACKEND
=
mxnet python3 gcn_trainer.py
--ip
127.0.0.1:2049
--num-sender
=
1
--dataset
reddit-self-loop
--num-neighbors
2
--batch-size
1000
--test-batch-size
500
--n-hidden
64
DGLBACKEND
=
mxnet python3 gcn_trainer.py
--ip
127.0.0.1:2049
--num-sender
=
1
--dataset
reddit-self-loop
--num-neighbors
3
--batch-size
1000
--test-batch-size
500
0
--n-hidden
64
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