Commit 3327985d authored by L.S. Cook's avatar L.S. Cook Committed by Scott Cyphers

Backprop documentation got borked with new code added. (#926)

Also the ONNX how to import file was tested and it was discovered
that the wheel was actually output to a different directory than
the one specified.
parent 15f50ce1
......@@ -118,7 +118,7 @@ calculations for the adjustments to be further optimized.
.. literalinclude:: ../../../examples/mnist_mlp.cpp
:language: cpp
:lines: 172
:lines: 172-175
For any node ``N``, if the update for ``loss`` is ``delta``, the
......@@ -129,11 +129,12 @@ update computation for ``N`` will be given by the node
auto update = loss->backprop_node(N, delta);
The different update nodes will share intermediate computations. So to
get the updated value for the weights we just say:
get the updated values for the weights we just say:
.. literalinclude:: ../../../examples/mnist_mlp.cpp
:language: cpp
:lines: 168-178
:lines: 177-217
.. _update:
......@@ -152,5 +153,5 @@ compile clones of the nodes.
.. literalinclude:: ../../../examples/mnist_mlp.cpp
:language: cpp
:lines: 248-260
:lines: 220-226
......@@ -67,18 +67,23 @@ skip ahead to the next section, :ref:`install_ngonnx`.
$ export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
$ python3 setup.py bdist_wheel
#. After the Python3 binary wheel file (``ngraph-*.whl``) is prepared, install
with :command:`pip3`, or :command:`pip` in a virtual environment.
#. Check for the binary wheel file under ``/ngraph/python/dist/`` and activate a
Python3 virtual environment to work with ONNX.
.. code-block:: console
(your_venv) $ pip install -U build/dist/ngraph-0.1.0-cp35-cp35m-linux_x86_64.whl
$ cd dist/
$ python3 -m venv onnx
$ cd onnx/
$ . bin/activate
(onnx)$ pip install -U ngraph-0.2.0-cp35-cp35m-linux_x86_64.whl
#. Confirm ngraph is properly installed through a Python interpreter:
.. code-block:: console
(your_venv) $ python3
(onnx) $ python3
.. code-block:: python
......@@ -98,7 +103,7 @@ Install the ``ngraph-onnx`` companion tool using pip:
.. code-block:: console
(your_venv) $ pip install git+https://github.com/NervanaSystems/ngraph-onnx/
(onnx) $ pip install git+https://github.com/NervanaSystems/ngraph-onnx/
Importing a serialized model
......@@ -115,6 +120,26 @@ that has been trained on the CIFAR10 data set and serialized with
ONNX.
(Optional) Localize your export to the virtual environment
----------------------------------------------------------
For this example, let's say that our serialized file was output under our $HOME
directory, say at ``~/onnx_conversions/trained_model.onnx``. To make loading this
file easier, you can run the example below from your Venv in that directory. If
you invoke your python interpreter in a different directory, you will need to
specify the relative path to the location of the ``.onnx`` file.
.. important:: If you invoke your Python interpreter in directory other than
where you outputted your trained model, you will need to specify the
**relative** path to the location of the ``.onnx`` file.
.. code-block:: console
(onnx) $ cd ~/onnx_conversions
(onnx) $ python3
Enable ONNX and load an ONNX file from disk
--------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment