This repository was archived by the owner on Nov 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ cp ../../build/cpp-package/example/lenet_with_mxdataiter .
3636cp ../../build/cpp-package/example/resnet .
3737./resnet 5
3838
39+ cp ../../build/cpp-package/example/inception_bn .
40+ ./inception_bn 5
41+
3942cp ../../build/cpp-package/example/mlp .
4043./mlp
4144
You can’t perform that action at this time.
0 commit comments