This project is about how to run the forward process of a Nerual Network on an embedded system.
Programming Environment: ESP-IDF (v5.1.1)
Microprocessor: ESP32-S3 N16R8
- conv1d layer
- flatten layer
- linear layer
- ReLU layer
This example donates a simple neural network, including a conv1d
layer and a linear
layer.
The size of input, output, weights and bias and the model itself are in model.h
.
The hello_world_main.c
file defines the neural network and uses a dummy input data to test the network.
You can modify these two files to define and run your own network.
Make sure you have downloaded the ESP-IDF and Git before getting start!
- download the code
git clone https://github.com/wjc1207/ESP32_NN_by_hand.git
- clean the build
idf.py fullclean
- build and flash the code to the ESP32
idf.py flash -p <port>
- open the monitor to see the results
idf.py monitor -p <port>
If everything works well, you should see the following output:
0.046326
0.121813
0.021277
-0.025692
Time: 8176
The convert_json_to_h.py
can be used to convert the model in json
file into the .h
file directly.