Simple Autoencoder to Cortex-M4 (CMSIS-NN)


My goal is to train a simple autoencoder with pytorch, somehow quantize the parameters so that they can be used with CMSIS-NN and run the model on a Cortex-M4-Microcontroller.

So far I’ve found a video which explains how to quantize a model for the mnist dataset:
I haven’t found clear information though on a more general level though.

Is it possible to archive my goal using pytorch und glow?

If yes, are there any examples of something similar? Or is there documentation that describes the necessary steps?

Thank you

Bun Cha

Hi, you should be able to follow very similar steps just using your model and some inputs that are reasonably close to what you expect to see in the real world, and then run with the -dump-profile=example.yml option. This runs the model in a floating point mode on the CPU to generate a profile of values flowing through your graph. Then that profile can be used when reloading the model, with --load-profile=example.yml, which quantizes the model with that profile, and compiles it.