Extracting Weights & Biases for AIE-ML Inference Solution - Extracting Weights & Biases for AIE-ML Inference Solution - 2025.2 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2026-03-27
Version
2025.2 English

The final step before building an AIE-ML inference solution is to obtain quantized weights for the trained MNIST ConvNet classifier. For simplicity in this tutorial, choose a bfloat16 implementation because quantization is straightforward. Each weight and bias shares the same exponent and uses an 8-bit quantized mantissa, instead of the 24-bit mantissa in full-precision Keras floating-point values. The following code extracts the weights and biases from the Keras model, quantizes them to bfloat16 and then saves them in files for validating each layer of the network to be designed in the following AIE-ML.

figure5