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

Commit f2ca66f

Browse files
royweinswamy
authored andcommitted
add cpp example inception to nightly test (#13534)
* add inception test * fix max iter for mlp * rename and add comment * rename epoch num
1 parent 7d2b804 commit f2ca66f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cpp-package/example/mlp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ void MLP() {
144144
grad_req_type, aux_states);
145145

146146
std::cout << "Training" << std::endl;
147-
int max_iters = 20000;
147+
int max_epoch = 15000;
148148
mx_float learning_rate = 0.0001;
149-
for (int iter = 0; iter < max_iters; ++iter) {
149+
for (int epoch_num = 0; epoch_num < max_epoch; ++epoch_num) {
150150
exe->Forward(true);
151-
152-
if (iter % 100 == 0) {
153-
std::cout << "epoch " << iter << std::endl;
151+
// print accuracy every 100 epoch
152+
if (epoch_num % 100 == 0) {
153+
std::cout << "epoch " << epoch_num << std::endl;
154154
std::vector<NDArray>& out = exe->outputs;
155155
float* cptr = new float[128 * 10];
156156
out[0].SyncCopyToCPU(cptr, 128 * 10);

cpp-package/tests/ci_test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ cp ../../build/cpp-package/example/lenet_with_mxdataiter .
3636
cp ../../build/cpp-package/example/resnet .
3737
./resnet 5
3838

39+
cp ../../build/cpp-package/example/inception_bn .
40+
./inception_bn 5
41+
3942
cp ../../build/cpp-package/example/mlp .
4043
./mlp
4144

0 commit comments

Comments
 (0)