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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b61857ba2ed5a0476687f939fa148d1705f4588135a69c74a2025799560a65b |
|
MD5 | e6e98bcba2631385c54ffb84fe60620a |
|
BLAKE2b-256 | cee2d9340f2552ea02c61aafa247ef57c1445b05d918785472c0adc943849820 |
Close
Hashes for autoregressive_diffusion_pytorch-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d042748d8195ad94f032e02528bfcb08c17710e59c7e7f23d6b6a252e8d6b3a4 |
|
MD5 | f9902971e5259f7884ceb5e988bf9640 |
|
BLAKE2b-256 | ba2d25b20a8e9911f15fe8188e2df3a01430c0164fd2baf3cc2671c0739f4328 |