{"id":13493874,"url":"https://github.com/openai/pixel-cnn","last_synced_at":"2025-05-15T18:03:59.927Z","repository":{"id":41055442,"uuid":"62925121","full_name":"openai/pixel-cnn","owner":"openai","description":"Code for the paper \"PixelCNN++: A PixelCNN Implementation with Discretized Logistic Mixture Likelihood and Other Modifications\"","archived":false,"fork":false,"pushed_at":"2020-02-03T06:39:20.000Z","size":671,"stargazers_count":1937,"open_issues_count":37,"forks_count":437,"subscribers_count":225,"default_branch":"master","last_synced_at":"2025-04-07T23:06:10.611Z","etag":null,"topics":["paper"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1701.05517","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-09T00:44:56.000Z","updated_at":"2025-04-07T12:54:47.000Z","dependencies_parsed_at":"2022-09-20T22:00:25.886Z","dependency_job_id":null,"html_url":"https://github.com/openai/pixel-cnn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fpixel-cnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fpixel-cnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fpixel-cnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openai%2Fpixel-cnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openai","download_url":"https://codeload.github.com/openai/pixel-cnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394720,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["paper"],"created_at":"2024-07-31T19:01:19.569Z","updated_at":"2025-05-15T18:03:59.899Z","avatar_url":"https://github.com/openai.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"**Status:** Archive (code is provided as-is, no updates expected)\n\n\n# pixel-cnn++\n\nThis is a Python3 / [Tensorflow](https://www.tensorflow.org/) implementation \nof [PixelCNN++](https://openreview.net/pdf?id=BJrFC6ceg), as described in the following \npaper:\n\n**PixelCNN++: A PixelCNN Implementation with Discretized Logistic Mixture Likelihood and Other Modifications**, by\nTim Salimans, Andrej Karpathy, Xi Chen, Diederik P. Kingma, and Yaroslav Bulatov.\n\nOur work builds on PixelCNNs that were originally proposed in [van der Oord et al.](https://arxiv.org/abs/1606.05328) \nin June 2016. PixelCNNs are a class of powerful generative models with tractable \nlikelihood that are also easy to sample from. The core convolutional neural network\ncomputes a probability distribution over a value of one pixel conditioned on the values\nof pixels to the left and above it. Below are example samples from a model\ntrained on CIFAR-10 that achieves **2.92 bits per dimension** (compared to 3.03 of \nthe PixelCNN in van der Oord et al.):\n\nSamples from the model (**left**) and samples from a model that is conditioned\non the CIFAR-10 class labels (**right**):\n\n![Improved PixelCNN papers](data/pixelcnn_samples.png)\n\nThis code supports multi-GPU training of our improved PixelCNN on [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html)\nand [Small ImageNet](http://image-net.org/small/download.php), but is easy to adapt\nfor additional datasets. Training on a machine with 8 Maxwell TITAN X GPUs achieves\n3.0 bits per dimension in about 10 hours and it takes approximately 5 days to converge to 2.92.\n\n## Setup\n\nTo run this code you need the following:\n\n- a machine with multiple GPUs\n- Python3\n- Numpy, TensorFlow and imageio packages:\n```\npip install numpy tensorflow-gpu imageio\n```\n\n## Training the model\n\nUse the `train.py` script to train the model. To train the default model on \nCIFAR-10 simply use:\n\n```\npython3 train.py\n```\n\nYou might want to at least change the `--data_dir` and `--save_dir` which\npoint to paths on your system to download the data to (if not available), and\nwhere to save the checkpoints.\n\n**I want to train on fewer GPUs**. To train on fewer GPUs we recommend using `CUDA_VISIBLE_DEVICES` \nto narrow the visibility of GPUs to only a few and then run the script. Don't forget to modulate\nthe flag `--nr_gpu` accordingly.\n\n**I want to train on my own dataset**. Have a look at the `DataLoader` classes\nin the `data/` folder. You have to write an analogous data iterator object for\nyour own dataset and the code should work well from there.\n\n## Pretrained model checkpoint\n\nYou can download our pretrained (TensorFlow) model that achieves 2.92 bpd on CIFAR-10 [here](http://alpha.openai.com/pxpp.zip) (656MB).\n\n## Citation\n\nIf you find this code useful please cite us in your work:\n\n```\n@inproceedings{Salimans2017PixeCNN,\n  title={PixelCNN++: A PixelCNN Implementation with Discretized Logistic Mixture Likelihood and Other Modifications},\n  author={Tim Salimans and Andrej Karpathy and Xi Chen and Diederik P. Kingma},\n  booktitle={ICLR},\n  year={2017}\n}\n```\n# pixel-cnn-rotations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenai%2Fpixel-cnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenai%2Fpixel-cnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenai%2Fpixel-cnn/lists"}