Skip to main content

Ultra-minimal autoregressive diffusion model for image generation

Project description

Aggressor: Ultra-minimal autoregressive diffusion model for image generation

A simplest possible implementation of Autoregressive Image Generation without Vector Quantization.

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

python aggressor.py

Alt text

Alt text

(Training on 60000 images x 20 epochs takes approximately 7~8 minutes on 8GB M2 MacBook.)

Acknowledgements

Thanks to lucidrains' fantastic code that inspired this project. The official implementation is available here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aggressor-0.0.1a0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

aggressor-0.0.1a0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file aggressor-0.0.1a0.tar.gz.

File metadata

  • Download URL: aggressor-0.0.1a0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for aggressor-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 d2d48b8745f2159841956ecc3f21eafe963ecac9450f93ede3041dcf2ad77dd1
MD5 42228aee568a1cb3aa5a2d8d34a24e14
BLAKE2b-256 b3d60a82440e138b61f05b206853a8e7b926d9d6a42386a26d76821193ddfa00

See more details on using hashes here.

File details

Details for the file aggressor-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: aggressor-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for aggressor-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 3651c92cf797bf4bd4d4ee5b1582ab72739efc41475cef28d0872dd5581defba
MD5 84b56ceea8f68d82c18073f987a47d72
BLAKE2b-256 50b0331aa22b0596181b7a38771df1b9ecda683e9ea700d2e018f16e4769fd01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page