-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Welcome to the project wiki of the Neural-Network-Translator project. This wiki covers all you need to know if you want to use or extend the Neural-Network-Translator.
Nowadays, neural networks are often modeled and trained with powerful frameworks, such as Microsoft Cognitive Toolkit (CNTK), Keras, or TensorFlow. While the training of these neural networks is often performed on very powerful hardware, the hardware of the final product on which the models will be executed later, however, is usually much less powerful due to the cost-driven requirements. Particularly in the embedded area, the question arises how the trained models can be implemented on the embedded systems used in practice.
One possible solution is, for example, a code translator, which makes it possible to translate a neural network model into native code for a specified platform of an embedded device. Thereby, various device-dependent restrictions and different programming languages must be taken into account. Therefore, the code generator must have a modular structure to allow the export to different platforms and programming languages.
Short research in advance has shown that currently there is no such tool that allows the translation of a neural network model to native code for embedded controllers. However, especially in the age of today's development, a continuous and automated build chain is necessary to remain competitive in the market, which is why there is a need for a tool to close this gap in the tool-chain.
Within the scope of this project, an implementation of such a code translator was developed. The project started with an implementation of the code generator for neural network models created with Keras which then can be translated to native C-code which can be compiled with the GCC compiler. In addition to that two proof of concepts were created to extract information from models created with the Microsoft Cognitive Toolkit and the PyTorch framework.
The goal is to translate a given neural network model containing information about its structure and data, such as weights and bias values, to a general intermediate file format. This file format simply is a JSON-file that holds all relevant information of the neural network model. Using the given JSON-file as an intermediate layer allows us to split the translation process into two subprocesses. The frontend handles the information extraction from the neural network model and the parsing of this information in the general file format. To verify the correctness of the intermediate file format, a schema file is provided. After having populated the intermediate file completely, the backend can translate the information given in the intermediate file format into platform-specific code. Thereby, the implementation of each the frontend and the backend is completely up to the developer of the plug-ins. The following figure shows the concept in a compact way.