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
-9
lines changed
Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ void OutputAccuracy(mx_float* pred, mx_float* target) {
4949 std::cout << " Accuracy: " << right / 128.0 << std::endl;
5050}
5151
52- void MLP () {
52+ void MLP (int max_epoch ) {
5353 auto sym_x = Symbol::Variable (" X" );
5454 auto sym_label = Symbol::Variable (" label" );
5555
@@ -144,7 +144,6 @@ void MLP() {
144144 grad_req_type, aux_states);
145145
146146 std::cout << " Training" << std::endl;
147- int max_epoch = 15000 ;
148147 mx_float learning_rate = 0.0001 ;
149148 for (int epoch_num = 0 ; epoch_num < max_epoch; ++epoch_num) {
150149 exe->Forward (true );
@@ -173,8 +172,8 @@ void MLP() {
173172}
174173
175174int main (int argc, char ** argv) {
176- MLP ();
175+ int max_epoch = argc > 1 ? strtol (argv[1 ], NULL , 10 ) : 15000 ;
176+ MLP (max_epoch);
177177 MXNotifyShutdown ();
178178 return 0 ;
179179}
180-
Original file line number Diff line number Diff line change @@ -25,22 +25,22 @@ ls -l ../../lib/
2525./get_data.sh
2626
2727cp ../../build/cpp-package/example/lenet .
28- ./lenet 10
28+ ./lenet 1
2929
3030cp ../../build/cpp-package/example/alexnet .
3131./alexnet 1
3232
3333cp ../../build/cpp-package/example/lenet_with_mxdataiter .
34- ./lenet_with_mxdataiter 5
34+ ./lenet_with_mxdataiter 1
3535
3636cp ../../build/cpp-package/example/resnet .
37- ./resnet 5
37+ ./resnet 1
3838
3939cp ../../build/cpp-package/example/inception_bn .
40- ./inception_bn 5
40+ ./inception_bn 1
4141
4242cp ../../build/cpp-package/example/mlp .
43- ./mlp
43+ ./mlp 150
4444
4545cp ../../build/cpp-package/example/mlp_cpu .
4646./mlp_cpu
You can’t perform that action at this time.
0 commit comments