Skip to content

Commit

Permalink
[CI] enable tutorial test in CI. (#631)
Browse files Browse the repository at this point in the history
* enable tutorial test in CI.

* reduce overhead.
  • Loading branch information
zheng-da committed Jun 13, 2019
1 parent 7d61936 commit be58224
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
20 changes: 10 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ pipeline {
// unit_test_linux("pytorch", "cpu")
// }
//}
//stage("Tutorial test") {
// steps {
// tutorial_test_linux("mxnet")
// }
//}
stage("Tutorial test") {
steps {
tutorial_test_linux("mxnet")
}
}
}
}
stage("MXNet GPU") {
Expand All @@ -243,11 +243,11 @@ pipeline {
// unit_test_linux("pytorch", "cpu")
// }
//}
//stage("Tutorial test") {
// steps {
// tutorial_test_linux("mxnet")
// }
//}
stage("Tutorial test") {
steps {
tutorial_test_linux("mxnet")
}
}
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions tutorials/models/5_giant_graph/1_sampling_mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ def forward(self, nf):
# dropout probability
dropout = 0.2
# batch size
batch_size = 10000
batch_size = 1000
# number of neighbors to sample
num_neighbors = 8
num_neighbors = 4
# number of epochs
num_epochs = 1

Expand All @@ -267,6 +267,7 @@ def forward(self, nf):
{'learning_rate': 0.03, 'wd': 0})

for epoch in range(num_epochs):
i = 0
for nf in dgl.contrib.sampling.NeighborSampler(g, batch_size,
num_neighbors,
neighbor_type='in',
Expand All @@ -291,6 +292,10 @@ def forward(self, nf):
# optimization
trainer.step(batch_size=1)
print("Epoch[{}]: loss {}".format(epoch, loss.asscalar()))
i += 1
# We only train the model with 32 mini-batches just for demonstration.
if i >= 32:
break

##############################################################################
# Control Variate
Expand Down

0 comments on commit be58224

Please sign in to comment.