https://github.com/josefalbers/aggressor
Ultra-minimal autoregressive diffusion model for image generation
https://github.com/josefalbers/aggressor
artificial-intelligence audio-generation autoregressive autoregressive-diffusion autoregressive-models deep-learning diffusion diffusion-models image-generation mlx tts
Last synced: 4 months ago
JSON representation
Ultra-minimal autoregressive diffusion model for image generation
- Host: GitHub
- URL: https://github.com/josefalbers/aggressor
- Owner: JosefAlbers
- License: apache-2.0
- Created: 2024-09-12T23:07:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-06T04:03:56.000Z (almost 2 years ago)
- Last Synced: 2025-12-22T00:38:05.707Z (7 months ago)
- Topics: artificial-intelligence, audio-generation, autoregressive, autoregressive-diffusion, autoregressive-models, deep-learning, diffusion, diffusion-models, image-generation, mlx, tts
- Language: Python
- Homepage:
- Size: 2.36 MB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aggressor: Ultra-minimal autoregressive diffusion model for image and speech generation
**CIFAR**
**MNIST**
**AUDIO**


[audio](https://github.com/user-attachments/assets/89574625-2ec0-4aeb-884f-bf03e5a4aab0)
A simplest possible implementation of [Autoregressive Image Generation without Vector Quantization](https://arxiv.org/abs/2406.11838).
## Key Features
- **Simple Architecture**: A tiny transformer for autoregression and an MLP for diffusion.
- **Minimal Dependencies**: Built from scratch using only basic MLX operations.
- **Single-File Implementation**: Entire model in one Python file `aggressor.py`.
## Components
- `Aggressor`: Main model class combining transformer and diffusion.
- `Transformer`: Multi-layer transformer with attention and MLP blocks.
- `Denoiser`: MLP-based diffusion process with time embedding.
- `Scheduler`: Handles forward and backward processes for diffusion.
## Usage
```zsh
python aggressor.py
```
*(Training on 60000 images x 20 epochs takes approximately 7~8 minutes on 8GB M2 MacBook.)*
## Acknowledgements
Thanks to [lucidrains](https://github.com/lucidrains/autoregressive-diffusion-pytorch)' fantastic code that inspired this project. The official implementation is available [here](https://github.com/LTH14/mar).