Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
add cpp example inception to nightly test (#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 nswamy committed Dec 8, 2018
1 parent 7d2b804 commit f2ca66f
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 f2ca66f

Please sign in to comment.