Posts

Showing posts from April, 2022

CFU Playground (3) - ML on a board (Arduino nano 33 ble )

Image
I am going through this step without running Tensorflow lite micro in the Risc-V environment in the CFU Playground. It doesn't matter if you are familiar with Tensorflow lite micro, but if not like me, you need to port your own model and check if it works properly. The reason for choosing Arduino nano 33 ble is that it has luxurious specifications compared to Arduino uno. It has Cortex-M4, 64Mhz, 256KB SRAM, 1MB Flash Memory, and sensors such as a gyroscope built-in. So, you can do interesting experiments in the future. Starting with a board with too little memory and poor CPU performance can incur many complicated errors. And you have to spend a lot of effort to optimize your code for fitting into the memory. https://store-usa.arduino.cc/products/arduino-nano-33-ble?selectedStore=us When it comes to price, ESP32 DevKit can also be an alternative. But Tensorflow Lite Micro in ESP32 is supported only on ESP-IDE. The ESP-IDE is less convient than Arduino IDE. Above all, the advantage...

CFU Playground (2) - CNN - tensorflow lite model

 It is not very difficult to change the code from Pytorch to Tensorflow one-to-one, but there are restrictions to use Tensorflow lite micro. Tensorflow lite micro provides various libraries, utilities, and examples in C++ so that it can be run on a microcontroller using ARM core or Tensillica. However, not all neural networks are possible. What is definitely available is a CNN, and a basic fully connected network library is possible. LSTM is on the Kernel, but when converting to Tensorflow lite converter, it was confirmed that errors occurred. Separately, I have seen Github of a person who achieved a degree by implementing LSTM in C. ( https://github.com/lephong/lstm-rnn )  If you look closely, you can refer to it, but in order to minimize uncertainty, I choose to convert the RNN model into a CNN model. Source code:  https://github.com/bxk218/RNN_wave_predictor_verilog/blob/main/tf_2D_CNN_wavePrediction.ipynb After changing the times series sequence to a 6x6 array, it loo...

CFU Playground (1) - Introduction

I t is not an official open source project of Google, but a very interesting project is in progress. (Refer to the site below for details) https://cfu-playground.readthedocs.io/en/latest/index.html To explain the concep briefly, it is a concept that puts a RISC-V soft-core in the FPGA and allows ML to run on the soft-core. The interesting point is that we can easily customize the core with accelerators on FPGA and also add more custom instructions. CFU playgound framework is composed of many good opensource products. So, it's free. We can practice it through many projects of Pete Warden, who devised TinyML using Tensorflow lite micro Framework a few years ago. And we can refer a few more interesting projects.  One of important enablers for CFU playground would be Tensorflow lite micro in conjuction with TinyML. The purpose of TinyML is to implement ML using only a few hundred KByte of memory in an ARM Cortex-M-class microcontroller. Tensorflow lite is already used a lot by people w...