Difference: TinyMLHelloWorldC (2 vs. 3)

Revision 32023-11-19 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="ESP32CExamples"

The tinyML Hello World example

How does tinyML hello world work?

Changed:
<
<
The program takes a value between 0 and 2Π and outputs the corresponding sine value. Of course this could be simply done passing through the sin function of the mathematics library. For demo purposes a neural network is created and trained by feeding it 1000 angle and sin(angle) pairs training it what the sin function is supposed to do. The trained model is converted from TensorFlow to TensorFlow Lite format and finally 'quantized' replacing the float values of the output model by int8 values thus drastically reducing the size of the model. The final model is transformed into char array within a C++ source file. This source file can finally easily be included into a C++ program running on the target processor (ESP32).
>
>
The program takes a value between 0 and 2Π and outputs the corresponding sine value. Of course, this could be simply done passing through the sin function of the mathematics library. For demo purposes a neural network is created and trained by feeding it 1000 angle and sin(angle) pairs training it what the sin function is supposed to do. The trained model is converted from TensorFlow to TensorFlow Lite format and finally 'quantized' replacing the float values of the output model by int8 values thus drastically reducing the size of the model. The final model is transformed into a char array within a C++ source file. This source file can finally easily be included into a C++ program running on the target processor (ESP32).
 

Model Creation

The model creation process is described in https://github.com/tensorflow/tflite-micro/tree/main/tensorflow/lite/micro/examples. In order for this to work he build tool bazel must be installed. In order to do this I used the binary installer. To get started with bazel, use the bazel tutorial.

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback