You will implement a letter recognition model which takes accelerometer data from the board and predicts the letter based on the accelerometer data.
Anaconda is a distribution of Python language for data science and machine learning. With Anaconda, you can easily install open-source machine learning packages.
With Anaconda installed, you will now install the necessary
conda packages for data collection and machine learning including
Follow the steps as shown below:
conda create -n ml_lab python=3.8
conda activate ml_lab
conda-forge channel to install packages:
conda config --add channels conda-forge
conda install jupyter pandas pyserial scikit-learn tensorflow matplotlib
Next, you need to program the STM32
B-L475E-IOT01A2 board to acquire accelerometer data for your neural network model.
The data collection code for this Learning Path is provided, so you can just import the project and program the board using STM Code IDE .
and expand it into a
Download and run the installer from the
Get Software section of the
STM32CubeIDE follow the steps below:
Import project and navigate to
Existing Projects into Workspace.
MCU Dataset Creation folder from the unzipped package as the root directory, and select
Dataset_Creation project. Click
Finish to import.
Run As. The project will rebuild, and be flashed to the device. If prompted, accept any suggested firmware updates.
In the same environment you activated using Anaconda earlier, navigate to your
tf_stm32 folder and enter:
jupyter notebook tf_stm32.ipynb
You are now ready to train your first neural network model with TensorFlow and deploy the inference with STM Cube AI.