From commits-return-56840-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Tue Oct 9 18:55:13 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E14EC18067E for ; Tue, 9 Oct 2018 18:55:10 +0200 (CEST) Received: (qmail 51330 invoked by uid 500); 9 Oct 2018 16:55:05 -0000 Mailing-List: contact commits-help@mxnet.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mxnet.incubator.apache.org Delivered-To: mailing list commits@mxnet.incubator.apache.org Received: (qmail 51094 invoked by uid 99); 9 Oct 2018 16:55:04 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2018 16:55:04 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] aaronmarkham commented on a change in pull request #12737: [MXNET-1017] Updating the readme file for cpp-package and adding readme file for example directory. Message-ID: <153910410442.25824.3917260135932567921.gitbox@gitbox.apache.org> Date: Tue, 09 Oct 2018 16:55:04 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit aaronmarkham commented on a change in pull request #12737: [MXNET-1017] Updating the readme file for cpp-package and adding readme file for example directory. URL: https://github.com/apache/incubator-mxnet/pull/12737#discussion_r223781918 ########## File path: cpp-package/example/README.md ########## @@ -0,0 +1,112 @@ +# MXNet C++ Package Examples + +## Building C++ examples + +The examples are built while building the MXNet library and cpp-package from source . However, they can be built manually as follows + +From cpp-package/examples directory + +- Build all examples in release mode: **make all** +- Build all examples in debug mode: **make debug** + +By default, the examples are build to be run on GPU. To build examples to run on CPU: + +- Release: **make all MXNET\_USE\_CPU=1** +- Debug: **make debug MXNET\_USE\_CPU=1** + +The examples that are build to be run on GPU may not work on the non-GPU machines. +The makefile will also download the necessary data files and store in data folder. (The download will take couple of minutes, but will be done only once on a fresh installation.) + + +## Examples + +This directory contains following examples. In order to run the examples, ensure that the path to the MXNet shared library is added to the OS specific environment variable such as _LD\_LIBRARY\_PATH_ . + +### [alexnet.cpp]() + +The example implements C++ version of AlexNet. The networks trains the MNIST data. The number of epochs can be specified as command line arguement. For example: + ``` + ./alexnet 10 + ``` + +### [charRNN.cpp]() + +The code implements C++ version charRNN for mxnet\example\rnn\char-rnn.ipynb with MXNet.cpp API. The generated params file is compatiable with python version. The train() and predict() has been verified with original data samples. + +The example expects arguments as follows: + +``` + ./charRNN train [BuildIn\ [TImeMajor] {corpus file} { batch size} { max epoch} [{starting epoch}] + ./charRNN predict [BuildIn\ [TImeMajor] {param file} { batch size} { max epoch} [{starting epoch}] +``` + +### [googlenet.cpp]() + +The code implements GoogLeNet/Inception network using C++ API. The example uses MNIST data to train the network. The number of epochs can be specified in the command line as follows. If not specified, the model trains for 100 epochs. + +``` +./googlenet 10 +``` + +### [mlp.cpp]() + +The code implements multilayer perceptron from scratch. The example creates its own dummy data to train the model. The example does not require command line parameters. It trains the model for 20000 iterations. + +``` +./mlp +``` + +### [mlp_cpu.cpp]() + +The code implements multilayer perceptron to train the MNIST data. The code demonstrates the use of "SimpleBind" C++ API and MNISTIter. The example is designed to work on CPU. The example does not require command line parameters. + +``` +./mlp_cpu +``` + +### [mlp_gpu.cpp]() +The code implements multilayer perceptron to train the MNIST data. The code demonstrates the use of "SimpleBind" C++ API and MNISTIter. The example is designed to work on GPU. The example does not require command line paratmeters. + +``` +./mlp_gpu +``` + +### [mlp_csv.cpp]() +The code implements multilayer perceptron to train the MNIST data. The code demonstrates the use of "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: + +``` +mlp_csv --train mnist_training_set.csv --test mnist_test_set.csv --epochs 10 --batch_size 100 --hidden_units "128,64,64 [--gpu]" +``` + +### [resnet.cpp]() + +The code implements resnet model using C++ API. The model is used to train MNIST data. The number of epochs for training the model can be specified on the command line. By default, model is trained for 100 epochs. + +``` +./resnet 10 +``` + +### [lenet.cpp]() + +The code implements lenet model using C++ API. It uses MNIST training data in CSV format to train the network. The example does not use built-in CSVIter to read the data from CSV file. The number of epochs can be specified on the command line. By default, the mode is trained for 100000 epochs. + +``` +./lenet 10 +``` +### [lenet\_with\_mxdataiter.cpp]() + +The code implements lenet model using C++ API. It uses MNIST training data to train the network. The example uses built-in MNISTIter to read the data. The number of epochs can be specified on the command line. By default, the mode is trained for 100 epochs. + +``` +./lenet\_with\_mxdataiter 10 +``` + +In addition, there is `run_lenet_with_mxdataiter.sh` that downloads the mnist data and run `lenet_with_mxdataiter` example. + +###[inception_bn.cpp]() + +The code implements Inception network using C++ API with batch normalization. The example uses MNIST data to train the network. The model trains for 100 epochs. Review comment: an Inception... using the C++... The example can be run by executing the following command: ---------------------------------------------------------------- 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