PixelCNN++ speedup via caching for real-time image generation
Top 64.7% on sourcepulse
This repository provides a method to significantly accelerate the image generation process of PixelCNN++ models. It targets researchers and practitioners working with autoregressive generative models who need faster inference times, achieving up to a 183x speedup over naive implementations.
How It Works
The core innovation is caching previously computed hidden states within the convolutional layers. Naive PixelCNN++ implementations recompute these states redundantly for each generated pixel. This approach intelligently reuses computations by maintaining a queue-like cache for each layer, proportional to its dilation factor. For layers with strided convolutions (downsampling/upsampling), a cache_every
parameter is introduced to manage cache updates, ensuring efficiency without sacrificing accuracy. This caching strategy minimizes redundant computations, leading to substantial speed gains.
Quick Start & Requirements
params_cifar.ckpt
).CUDA_VISIBLE_DEVICES=0 python generate.py --checkpoint=/path/to/params_cifar.ckpt --save_dir=/path/to/save/generated/images
Highlighted Details
Maintenance & Community
The project is authored by Prajit Ramachandran, Tom Le Paine, Pooya Khorrami, and Mohammad Babaeizadeh. A citation is provided for the associated paper: "Fast Generation for Convolutional Autoregressive Models" (arXiv:1704.06001).
Licensing & Compatibility
The repository does not explicitly state a license. The underlying PixelCNN++ model is typically associated with permissive licenses, but this specific implementation's licensing is not detailed.
Limitations & Caveats
The code is tested with Python 3 and TensorFlow 1.0, and may require modifications for other versions. The performance claims are based on a Tesla K40 GPU, and results may vary on different hardware.
8 years ago
1 day