You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/11/27 18:32:19 UTC

[GitHub] nswamy closed pull request #13273: [Example]Fix mlp_csv example

nswamy closed pull request #13273: [Example]Fix mlp_csv example
URL: https://github.com/apache/incubator-mxnet/pull/13273
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cpp-package/example/README.md b/cpp-package/example/README.md
index 06ea17bbc1f..c7223e94c92 100644
--- a/cpp-package/example/README.md
+++ b/cpp-package/example/README.md
@@ -69,7 +69,13 @@ build/mlp_gpu
 The code implements a multilayer perceptron to train the MNIST data. The code demonstrates the use of the "SimpleBind"  C++ API and CSVIter. The CSVIter can iterate data that is in CSV format. The example can be run on CPU or GPU. The example usage is as follows:
 
 ```
-build/mlp_csv --train mnist_training_set.csv --test mnist_test_set.csv --epochs 10 --batch_size 100 --hidden_units "128,64,64 [--gpu]"
+build/mlp_csv --train data/mnist_data/mnist_train.csv --test data/mnist_data/mnist_test.csv --epochs 10 --batch_size 100 --hidden_units "128 64 64" --gpu
+```
+* To get the `mnist_training_set.csv` and `mnist_test_set.csv` please run the following command:
+```python
+# in incubator-mxnet/cpp-package/example directory
+python mnist_to_csv.py ./data/mnist_data/train-images-idx3-ubyte ./data/mnist_data/train-labels-idx1-ubyte ./data/mnist_data/mnist_train.csv 60000
+python mnist_to_csv.py ./data/mnist_data/t10k-images-idx3-ubyte ./data/mnist_data/t10k-labels-idx1-ubyte ./data/mnist_data/mnist_test.csv 10000
 ```
 
 ### [resnet.cpp](<https://github.com/apache/incubator-mxnet/blob/master/cpp-package/example/resnet.cpp>)
diff --git a/cpp-package/example/mlp_csv.cpp b/cpp-package/example/mlp_csv.cpp
index 8aec4b76d91..43a14c84e6d 100644
--- a/cpp-package/example/mlp_csv.cpp
+++ b/cpp-package/example/mlp_csv.cpp
@@ -72,7 +72,7 @@ std::vector<int> getLayers(const std::string& hidden_units_string) {
 void printUsage() {
     std::cout << "Usage:" << std::endl;
     std::cout << "mlp_csv --train mnist_training_set.csv --test mnist_test_set.csv --epochs 10 "
-    << "--batch_size 100 --hidden_units \"128 64 64\" [--gpu]" << std::endl;
+    << "--batch_size 100 --hidden_units \"128 64 64\" --gpu" << std::endl;
     std::cout << "The example uses mnist data in CSV format. The MNIST data in CSV format assumes "
     << "the column 0 to be label and the rest 784 column to be data." << std::endl;
     std::cout << "By default, the example uses 'cpu' context. If '--gpu' is specified, "
diff --git a/cpp-package/tests/ci_test.sh b/cpp-package/tests/ci_test.sh
index 57007f3a81d..7674e2d988b 100755
--- a/cpp-package/tests/ci_test.sh
+++ b/cpp-package/tests/ci_test.sh
@@ -50,3 +50,5 @@ cp ../../build/cpp-package/example/mlp_gpu .
 
 cp ../../build/cpp-package/example/test_score .
 ./test_score 0.93
+
+sh unittests/unit_test_mlp_csv.sh


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services