The TinyML examples written in C++

The TinyML examples in C++, ported to the ESP32 can be found at https://github.com/espressif/tflite-micro-esp-examples/tree/master/examples

Hello World

There you can also find procedure to get the examples compiled. Let's start with the hello_world example.

We must first tell the idf.py that we are using an ESP32S3 chip:

idf.py set-target esp32s3

After that we may have to clean previous builds:

idf.py fullclean

and finally we can build the hello_world program:

idf.py build

Once the program is built we can flash it and connect the serial monitor to see the results:

idf.py flash monitor

The program repeatedly runs the induction for 20 angle values between 0 and 2Π. These values can easily be captured by redirecting the output to a file. I then used an editor to prepare the data to be plotted with gnuplot.

idf.py flash monitor | tee results.txt

Finally I wrote a simple Python program calculating the correct 20 sine values, which allows to compare them to the results from TinyML.

results.png

-- Uli Raich - 2023-09-02

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng results.png r1 manage 24.2 K 2023-09-02 - 14:28 UliRaich  
Edit | Attach | Watch | Print version | History: r6 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2023-09-02 - UliRaich
 
  • Edit
  • Attach
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