# Aggressor: Ultra-minimal autoregressive diffusion model for image generation
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.
- **Single-File Implementation**: Entire model in one Python file.
- **Minimal Dependencies**: Built from scratch using only basic MLX operations.
## 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.
- `Attention`: Multi-head attention mechanism.
- `MLP`: Basic multi-layer perceptron with SiLU activation.
## Usage
```zsh
python aggressor.py
```
![Alt text](https://raw.githubusercontent.com/JosefAlbers/Aggressor/main/assets/aggressor_cifar.png)
![Alt text](https://raw.githubusercontent.com/JosefAlbers/Aggressor/main/assets/aggressor_mnist.png)
*(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).
Raw data
{
"_id": null,
"home_page": "https://github.com/JosefAlbers/Aggressor",
"name": "aggressor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12.3",
"maintainer_email": null,
"keywords": null,
"author": "Josef Albers",
"author_email": "albersj66@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b3/d6/0a82440e138b61f05b206853a8e7b926d9d6a42386a26d76821193ddfa00/aggressor-0.0.1a0.tar.gz",
"platform": null,
"description": "# Aggressor: Ultra-minimal autoregressive diffusion model for image generation\n\nA simplest possible implementation of [Autoregressive Image Generation without Vector Quantization](https://arxiv.org/abs/2406.11838).\n\n## Key Features\n\n- **Simple Architecture**: A tiny transformer for autoregression and an MLP for diffusion.\n- **Single-File Implementation**: Entire model in one Python file.\n- **Minimal Dependencies**: Built from scratch using only basic MLX operations.\n\n## Components\n\n- `Aggressor`: Main model class combining transformer and diffusion.\n- `Transformer`: Multi-layer transformer with attention and MLP blocks.\n- `Denoiser`: MLP-based diffusion process with time embedding.\n- `Scheduler`: Handles forward and backward processes for diffusion.\n- `Attention`: Multi-head attention mechanism.\n- `MLP`: Basic multi-layer perceptron with SiLU activation.\n\n## Usage\n\n```zsh\npython aggressor.py\n```\n\n![Alt text](https://raw.githubusercontent.com/JosefAlbers/Aggressor/main/assets/aggressor_cifar.png)\n\n![Alt text](https://raw.githubusercontent.com/JosefAlbers/Aggressor/main/assets/aggressor_mnist.png)\n\n*(Training on 60000 images x 20 epochs takes approximately 7~8 minutes on 8GB M2 MacBook.)*\n\n## Acknowledgements\n\nThanks 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).\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Ultra-minimal autoregressive diffusion model for image generation",
"version": "0.0.1a0",
"project_urls": {
"Homepage": "https://github.com/JosefAlbers/Aggressor"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "50b0331aa22b0596181b7a38771df1b9ecda683e9ea700d2e018f16e4769fd01",
"md5": "84b56ceea8f68d82c18073f987a47d72",
"sha256": "3651c92cf797bf4bd4d4ee5b1582ab72739efc41475cef28d0872dd5581defba"
},
"downloads": -1,
"filename": "aggressor-0.0.1a0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "84b56ceea8f68d82c18073f987a47d72",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12.3",
"size": 5745,
"upload_time": "2024-09-19T04:17:45",
"upload_time_iso_8601": "2024-09-19T04:17:45.322890Z",
"url": "https://files.pythonhosted.org/packages/50/b0/331aa22b0596181b7a38771df1b9ecda683e9ea700d2e018f16e4769fd01/aggressor-0.0.1a0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b3d60a82440e138b61f05b206853a8e7b926d9d6a42386a26d76821193ddfa00",
"md5": "42228aee568a1cb3aa5a2d8d34a24e14",
"sha256": "d2d48b8745f2159841956ecc3f21eafe963ecac9450f93ede3041dcf2ad77dd1"
},
"downloads": -1,
"filename": "aggressor-0.0.1a0.tar.gz",
"has_sig": false,
"md5_digest": "42228aee568a1cb3aa5a2d8d34a24e14",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12.3",
"size": 5619,
"upload_time": "2024-09-19T04:17:46",
"upload_time_iso_8601": "2024-09-19T04:17:46.788166Z",
"url": "https://files.pythonhosted.org/packages/b3/d6/0a82440e138b61f05b206853a8e7b926d9d6a42386a26d76821193ddfa00/aggressor-0.0.1a0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-19 04:17:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JosefAlbers",
"github_project": "Aggressor",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aggressor"
}