`nnkit` is collection of neural networks tools for our _nncc_ project.
-## nni
+## nnkit-run
-`nni` is a command line interface to interact with existing inference engines
+`nnkit-run` is a command line interface to interact with existing inference engines
or compiled artifacts.
-## How nni works
+## How nnkit-run works
-`nni` first dynamically loads `backend` and multiple pre/post `action`
-specified by command-line. After loading backend and actions, `nni` requests
+`nnkit-run` first dynamically loads `backend` and multiple pre/post `action`
+specified by command-line. After loading backend and actions, `nnkit-run` requests
`backend` to prepare itself. When backend is prepared, `backend` exposes its
-internal state to `nni` (as `nnkit::TensorContext`).
-`nni` takes this state, and passes it to registered pre `action`(s).
+internal state to `nnkit-run` (as `nnkit::TensorContext`).
+`nnkit-run` takes this state, and passes it to registered pre `action`(s).
Each action may read tensor(s) (e.g. dump the content into a file),
or manipuate their value (e.g. fill random values).
-`nni` then invokes `backend` through `run()` method.
+`nnkit-run` then invokes `backend` through `run()` method.
After successful running the `backend`, post `action`(s) are called same like
pre `action`(s) as a teardown step.
- Caffe as `libnnkit_caffe_backend.so`
- Tensorflow Lite as `libnnkit_tflite_backend.so`
-# How to run inference with nni
+# How to run inference with nnkit-run
-To run `nni`, we need to provide a backend module and argument(s) if required
+To run `nnkit-run`, we need to provide a backend module and argument(s) if required
and optional `pre-` or `post-` action module(s)
## Building backends
For example,
```
-nni \
+nnkit-run \
--backend ./path/to/backend --backend-arg arg1 --backend-arg arg2 \
--pre ./path/to/preA --pre-arg arg1preA --pre-arg arg2preA \
--pre ./path/to/preB --pre-arg arg1preB --pre-arg arg2preB \
```
cd build
-contrib/nnkit/tools/nni/nni \
+contrib/nnkit/tools/run/nnkit-run \
--backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \
--backend-arg inceptionv3_non_slim_2015.tflite
```
```
cd build
-contrib/nnkit/tools/nni/nni \
+contrib/nnkit/tools/run/nnkit-run \
--backend ./contrib/nnkit/backends/caffe/libnnkit_caffe_backend.so
--backend-arg inception_v3.prototxt
```
```
cd build
-contrib/nnkit/tools/nni/nni \
+contrib/nnkit/tools/run/nnkit-run \
--backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \
--backend-arg inceptionv3_non_slim_2015.tflite \
--post ./contrib/nnkit/actions/builtin/libnnkit_show_action.so
The following command initializes input tensors with random values generated by `RandomizeAction` pre-action.
```
-contrib/nnkit/tools/nni/nni \
+contrib/nnkit/tools/run/nnkit-run \
--backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \
--backend-arg inceptionv3_non_slim_2015.tflite \
--pre ./contrib/nnkit/actions/builtin/libnnkit_randomize_action.so \
```
cd build
-contrib/nnkit/tools/nni/nni \
+contrib/nnkit/tools/run/nnkit-run \
--backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \
--backend-arg inceptionv3_non_slim_2015.tflite \
--pre ./contrib/nnkit/actions/HDF5/libnnkit_HDF5_export_action.so \