AN 1011: TinyML Applications in Altera FPGAs Using LiteRT for Microcontrollers
ID
848984
Date
9/29/2025
Public
1. Overview
2. Preparing LiteRT Inference Model
3. Generating Nios® V Processor System
4. Generating Arm Processor System
5. Programming and Running
6. Nios® V Processor with TinyML Design Example
7. Appendix
8. Document Revision History for the AN 1011: TinyML Applications in Altera FPGAs Using LiteRT for Microcontrollers
2.3.3. Training Model
Feed the training data into the model in batches and validate the model on the validation set after each epoch to monitor performance. Using the Matplotlib library, you can display the training and validation accuracy in a line graph.
# Train and Validate the Model epochs = 10 history = model.fit(x_train, y_train, epochs=epochs, batch_size=128, validation_data = (x_test, y_test), verbose=1) # Display the Training Progress def summary_history(history): plt.figure(figsize = (10,6)) plt.plot(history.history['accuracy'], color = 'blue', label = 'train') plt.plot(history.history['val_accuracy'], color = 'red', label = 'val') plt.legend() plt.title('Accuracy') plt.show() summary_history(history)
Figure 3. Training and Validation Logs
Figure 4. Training and Validation Accuracy per Epoches