Skip to content

Commit

Permalink
add cpp example inception to nightly test (apache#13534)
Browse files Browse the repository at this point in the history
* add inception test

* fix max iter for mlp

* rename and add comment

* rename epoch num
  • Loading branch information
roywei authored and zhaoyao73 committed Dec 9, 2018
1 parent 2266d87 commit 7337cc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cpp-package/example/mlp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions cpp-package/tests/ci_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7337cc0

Please sign in to comment.