•1 min read•from Machine Learning
I implemented a very tiny image generation model (latent flow transformer) on a RP2350 microcontroller - it can generate 128x128 images of faces [P]
![I implemented a very tiny image generation model (latent flow transformer) on a RP2350 microcontroller - it can generate 128x128 images of faces [P]](/_next/image?url=https%3A%2F%2Fpreview.redd.it%2Fr2vhg90066mh1.png%3Fwidth%3D140%26height%3D54%26auto%3Dwebp%26s%3D23f98a10b9cb9be363b1b1784dff017a6c1a18db&w=3840&q=75)
| Its a 2.4-4 million parameter model, quantized to int8, that can be fully executed on the microcontroller in ~20s with the longest generation. The generated image will then be displayed on a monitor or transferred via usb. Its a latent flow transformer with 12 layers using AdaLN-Zero for conditioning. CFG is also supported and boosted the image quality a lot. The inference engine streams the weight via DMA from the flash while the previous layer is computed. Relu² activation was used to increase sparsity, which the engine can use to skip calculations. Took a lot of ablations to get it right and I am quite astonished I got so far with so few parameters. Will post the repo below [link] [comments] |
Want to read more?
Check out the full article on the original site
Tagged with
#image generation
#latent flow transformer
#microcontroller
#RP2350
#int8 quantization
#parameter efficiency
#inference engine
#DMA
#flash memory
#sparsity
#Relu² activation
#AdaLN-Zero
#CFG (Classifier-Free Guidance)
#ablation studies
#128x128 images
#face generation
#machine learning
#embedded systems
#low-resource computing
#weight streaming