You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ns...@apache.org on 2018/12/08 03:58:09 UTC
[incubator-mxnet] branch master updated: add cpp example inception
to nightly test (#13534)
This is an automated email from the ASF dual-hosted git repository.
nswamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new f2ca66f add cpp example inception to nightly test (#13534)
f2ca66f is described below
commit f2ca66f2c537783aa60251080582793f42f395a7
Author: Lai Wei <ro...@gmail.com>
AuthorDate: Fri Dec 7 19:57:54 2018 -0800
add cpp example inception to nightly test (#13534)
* add inception test
* fix max iter for mlp
* rename and add comment
* rename epoch num
---
cpp-package/example/mlp.cpp | 10 +++++-----
cpp-package/tests/ci_test.sh | 3 +++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/cpp-package/example/mlp.cpp b/cpp-package/example/mlp.cpp
index 595d75c..cc16f53 100644
--- a/cpp-package/example/mlp.cpp
+++ b/cpp-package/example/mlp.cpp
@@ -144,13 +144,13 @@ void MLP() {
grad_req_type, aux_states);
std::cout << "Training" << std::endl;
- int max_iters = 20000;
+ int max_epoch = 15000;
mx_float learning_rate = 0.0001;
- for (int iter = 0; iter < max_iters; ++iter) {
+ for (int epoch_num = 0; epoch_num < max_epoch; ++epoch_num) {
exe->Forward(true);
-
- if (iter % 100 == 0) {
- std::cout << "epoch " << iter << std::endl;
+ // print accuracy every 100 epoch
+ if (epoch_num % 100 == 0) {
+ std::cout << "epoch " << epoch_num << std::endl;
std::vector<NDArray>& out = exe->outputs;
float* cptr = new float[128 * 10];
out[0].SyncCopyToCPU(cptr, 128 * 10);
diff --git a/cpp-package/tests/ci_test.sh b/cpp-package/tests/ci_test.sh
index 7674e2d..4a17d8d 100755
--- a/cpp-package/tests/ci_test.sh
+++ b/cpp-package/tests/ci_test.sh
@@ -36,6 +36,9 @@ cp ../../build/cpp-package/example/lenet_with_mxdataiter .
cp ../../build/cpp-package/example/resnet .
./resnet 5
+cp ../../build/cpp-package/example/inception_bn .
+./inception_bn 5
+
cp ../../build/cpp-package/example/mlp .
./mlp