From 9a17b5e3ebfe001ecbd527d45a0abb2d85134ad7 Mon Sep 17 00:00:00 2001 From: auphelia <jakobapk@web.de> Date: Mon, 9 Dec 2019 14:44:46 +0000 Subject: [PATCH] [notebook - code gen] Fixed some spelling mistakes in the notebook --- .../FINN-CodeGenerationAndCompilation.ipynb | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/notebooks/FINN-CodeGenerationAndCompilation.ipynb b/notebooks/FINN-CodeGenerationAndCompilation.ipynb index e1d5b841f..df2898975 100644 --- a/notebooks/FINN-CodeGenerationAndCompilation.ipynb +++ b/notebooks/FINN-CodeGenerationAndCompilation.ipynb @@ -41,9 +41,9 @@ "metadata": {}, "source": [ "### Example model\n", - "<font size=\"3\">To show the code generation and compilation of a node, an example model with a streaming fclayer node is first created. To learn more about FINN custom operation nodes, please take a look at notebook [FINN-CustomOps](FINN-CustomOps.ipynb).\n", + "<font size=\"3\">To show the code generation and compilation of a node, an example model with a StreamingFCLayer_Batch node is first created. To learn more about FINN custom operation nodes, please take a look at notebook [FINN-CustomOps](FINN-CustomOps.ipynb).\n", "\n", - "First TensorProto and helper are imported from ONNX. These functions can be used to create tensors, nodes, graphs and models in ONNX. Additional functions from `util` and the classes `DataType` and `ModelWrapper` are needed. More information about `DataType` and `ModelWrapper` can be found in Jupyter notebook [FINN-ModelWrapper](FINN-ModelWrapper.ipynb).</font>" + "First TensorProto and helper are imported from ONNX. These can be used to create tensors, nodes, graphs and models in ONNX. Additional functions from `util` and the classes `DataType` and `ModelWrapper` are needed. More information about `DataType` and `ModelWrapper` can be found in Jupyter notebook [FINN-ModelWrapper](FINN-ModelWrapper.ipynb).</font>" ] }, { @@ -62,7 +62,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "<font size=\"3\">Then all parameters, that are needed to create a streaming fclayer, are set. To keep the example clear small values are chosen. For more information about the parameters please take look at the documentation of the [finn-hls library](https://finn-hlslib.readthedocs.io/en/latest/).</font>" + "<font size=\"3\">Then all parameters, that are needed to create a StreamingFCLayer_Batch node, are set. To keep the example clear small values are chosen. For more information about the parameters please take a look at the documentation of the [finn-hls library](https://finn-hlslib.readthedocs.io/en/latest/).</font>" ] }, { @@ -84,7 +84,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "<font size=\"3\">A `tensor_value_info` is created for all tensors involved. In this case there is one tensor for the weights besides the input and output tensors. Then an input list is created containing the two inputs (`\"inp\"`and `\"weights\"`).</font>" + "<font size=\"3\">A `tensor_value_info` is created for all tensors involved. In this case there is one tensor for the weights besides the input and output tensors. Then an input list is created containing the two inputs (`\"inp\"`and `\"weights\"`).\n", + "\n", + "**Note**: A StreamingFCLayer_Batch node can also have an output activation which is passed in the form of thresholds as input tensor</font>" ] }, { @@ -240,7 +242,7 @@ "metadata": {}, "source": [ "### Code Generation\n", - "<font size=\"3\">Code generation is a transformation that can be applied to the model. For more information about transformation passes, see Jupyter Notebook [FINN-HowToTransformPass](FINN-HowToTransformPass.ipynb).\n", + "<font size=\"3\">Code generation is a transformation pass that can be applied to the model. For more information about transformation passes, see Jupyter Notebook [FINN-HowToTransformPass](FINN-HowToTransformPass.ipynb).\n", "\n", "The code generation transformation is shown below.</font>" ] @@ -436,7 +438,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "<font size=\"3\">A special function for code generation for the StreamingFCLayer_Batch node is the `generate_params(model)` function. Besides the normal input tensor, a fc layer has weight values as input and can get additional thresholds for activation. This function reads the values for the weights and thresholds via the `get_initializer` function of the ModelWrapper and writes them c++ conform in .h files, which are added to the includes. \n", + "<font size=\"3\">A special function for code generation for the StreamingFCLayer_Batch node is the `generate_params(model)` function. Besides the normal input tensor, an fc layer has weight values as input and can get additional thresholds for activation. This function reads the values for the weights and thresholds via the `get_initializer` function of the ModelWrapper and writes them c++ conform in .h files, which are added to the includes. \n", "\n", "The `generate_params` function of the StreamingFCLayer_Batch is shown below.</font>" ] @@ -539,7 +541,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "<font size=\"3\">The generated code is written to the previously created temporary directory and the node attribute `code_gen_dir` is set. This completes the code generation for executing a single CustomOp and the next step is compilation. </font>" + "<font size=\"3\">The generated code is written to the previously created temporary directory and the node attribute `code_gen_dir` is set. This completes the code generation for executing a single CustomOp. The next step is compilation. </font>" ] }, { @@ -801,7 +803,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "<font size=\"3\">First, all parameters are extracted using the `get_nodeattr` function. It is also important to read the code generation via `code_gen_dir`. The code is divided into three parts:</font>\n", + "<font size=\"3\">First, all parameters are extracted using the `get_nodeattr` function. It is also important to read the code generation via `code_gen_dir`. `execute_node` is divided into three parts:</font>\n", "* <font size=\"3\">creation of a npy file for each input of the node</font>\n", "* <font size=\"3\">execution of the precompiled model</font>\n", "* <font size=\"3\">loading the output npy file</font>" @@ -916,7 +918,7 @@ "\n", "**Important**: If the code is executed inside the docker container, the directory will be deleted after closing the container. \n", " \n", - "For further reading please see the /tests folder of the FINN repo. The subfolder /fpgadataflow contains the test for example: [test_fpgadataflow_fclayer.py](https://github.com/Xilinx/finn/blob/dev/tests/fpgadataflow/test_fpgadataflow_fclayer) which tests the functionality of the flow described above.</font>" + "For further reading please see the /tests folder of the FINN repo. The subfolder /fpgadataflow contains for example: [test_fpgadataflow_fclayer](https://github.com/Xilinx/finn/blob/dev/tests/fpgadataflow/test_fpgadataflow_fclayer.py) which tests the functionality of the flow described above.</font>" ] }, { -- GitLab