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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fca786b25bdba686d62b4fcb7d2a5f9de9adfc3b93a4b4f35f71163e56a6fc94 |
|
MD5 | ec6d82deb09f7eb89117334108d7f32a |
|
BLAKE2b-256 | 68b648c540daf703cb69b23747452cb739ca7d4dc75ab4f03d8a768b55350108 |
Close
Hashes for autoregressive_diffusion_pytorch-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e470e0a42bcfb8b9c42dc94703ca5cb1dba1d6ee3eb65bccf7177b09aeb7667a |
|
MD5 | 5c0dcc05b9b14fa5f5466609cb9f1ee5 |
|
BLAKE2b-256 | aa0e2ffe3bcac778759e257e2a40884e4b40ac359f19c098a11eb63b8e6ebf01 |