Autoregressive Diffusion - Pytorch
Project description
Autoregressive Diffusion - Pytorch (wip)
Implementation of the architecture behind Autoregressive Image Generation without Vector Quantization in Pytorch
You can discuss the paper temporarily here
Install
$ pip install autoregressive-diffusion-pytorch
Usage
import torch
from autoregressive_diffusion_pytorch import AutoregressiveDiffusion
model = AutoregressiveDiffusion(
dim = 512,
max_seq_len = 32
)
seq = torch.randn(3, 32, 512)
loss = model(seq)
loss.backward()
sampled = model.sample(batch_size = 3)
assert sampled.shape == seq.shape
For images treated as a sequence of tokens (as in paper)
import torch
from autoregressive_diffusion_pytorch import (
ImageAutoregressiveDiffusion
)
model = ImageAutoregressiveDiffusion(
model = dict(
dim = 512
),
image_size = 64,
patch_size = 8
)
images = torch.randn(3, 3, 64, 64)
loss = model(images)
loss.backward()
sampled = model.sample(batch_size = 3)
assert sampled.shape == images.shape
Citations
@article{Li2024AutoregressiveIG,
title = {Autoregressive Image Generation without Vector Quantization},
author = {Tianhong Li and Yonglong Tian and He Li and Mingyang Deng and Kaiming He},
journal = {ArXiv},
year = {2024},
volume = {abs/2406.11838},
url = {https://api.semanticscholar.org/CorpusID:270560593}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for autoregressive_diffusion_pytorch-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64bc268605432ca11083e07c58c2b2f17087eae004e1f385b6dc85a6018cb825 |
|
MD5 | f90e718a6447ca4614c12f97d3b830be |
|
BLAKE2b-256 | 1510d840b0662022d12507fadbf39be385646f5e9accff3e591a85ed2955b109 |
Close
Hashes for autoregressive_diffusion_pytorch-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d9b3b75231de91ba4cf59607a2b6e58949822a5c4839ec66cf4bdbeca40fe8b |
|
MD5 | bb1491a5526a65abfd99219d8fed8961 |
|
BLAKE2b-256 | da92ee499004386c2be17e0a5c15e2e9beabb718b8a0addc80966d52f6d19318 |