{"id":31003749,"url":"https://github.com/nadavbh12/vq-vae","last_synced_at":"2025-09-13T01:49:56.672Z","repository":{"id":38356025,"uuid":"115252321","full_name":"nadavbh12/VQ-VAE","owner":"nadavbh12","description":"Minimalist implementation of VQ-VAE in Pytorch","archived":false,"fork":false,"pushed_at":"2021-06-03T08:08:35.000Z","size":526,"stargazers_count":429,"open_issues_count":6,"forks_count":82,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-10-20T21:58:13.533Z","etag":null,"topics":["deep-learning","deep-neural-networks","mnist","pytorch","vae","vq-vae"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nadavbh12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-24T09:17:33.000Z","updated_at":"2023-10-19T10:48:18.000Z","dependencies_parsed_at":"2022-07-12T02:17:23.318Z","dependency_job_id":null,"html_url":"https://github.com/nadavbh12/VQ-VAE","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/nadavbh12/VQ-VAE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadavbh12%2FVQ-VAE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadavbh12%2FVQ-VAE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadavbh12%2FVQ-VAE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadavbh12%2FVQ-VAE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nadavbh12","download_url":"https://codeload.github.com/nadavbh12/VQ-VAE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nadavbh12%2FVQ-VAE/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274907868,"owners_count":25371821,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deep-learning","deep-neural-networks","mnist","pytorch","vae","vq-vae"],"created_at":"2025-09-13T01:49:52.731Z","updated_at":"2025-09-13T01:49:56.665Z","avatar_url":"https://github.com/nadavbh12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CVAE and VQ-VAE\n\nThis is an implementation of the VQ-VAE (Vector Quantized Variational Autoencoder) and Convolutional Varational Autoencoder.\nfrom [Neural Discrete representation learning](https://arxiv.org/pdf/1711.00937.pdf) for compressing MNIST and Cifar10.\nThe code is based upon [pytorch/examples/vae](https://github.com/pytorch/examples/tree/master/vae).\n\n```bash\npip install -r requirements.txt\npython main.py\n```\n\n## requirements\n\n- Python 3.6 (maybe 3.5 will work as well)\n- PyTorch 0.4\n- Additional requirements in requirements.txt\n\n# Usage\n\n```python\n# For example\npython3 main.py --dataset=cifar10 --model=vqvae --data-dir=~/.datasets --epochs=3\n```\n\n# Results\n\nAll images are taken from the test set.\nTop row is the original image. Bottom row is the reconstruction.\n\nk - number of elements in the dictionary. d - dimension of elements in the dictionary (number of channels in bottleneck).\n\n- MNIST (k=10, d=64)\n\n![mnist](/images/mnist.png)\n\n- CIFAR10 (k=128, d=256)\n\n![CIFAR10](/images/cifar10.png)\n\n- Imagenet (k=512, d=128)\n\n![imagenet](/images/imagenet.png)\n\n# TODO:\n\n- [ ] Implement [Continuous Relaxation Training of Discrete Latent Variable Image Models](http://bayesiandeeplearning.org/2017/papers/54.pdf)\n\n- [ ] Sample using PixelCNN prior\n\n- [ ] Improve results on cifar - nearest neighbor should be performed to 10 dictionaries rather than 1\n\n- [ ] Improve results on cifar - replace MSE with NLL\n\n- [ ] Improve results on cifar - measure bits/dim\n\n- [ ] Compare architecture with the [offical one](https://github.com/deepmind/sonnet/blob/master/sonnet/python/modules/nets/vqvae.py)\n\n- [x] Merge VAE and VQ-VAE for MNIST and Cifar to one script\n\n# Acknowledgement\n\n[tf-vaevae](https://github.com/hiwonjoon/tf-vqvae) for a good reference.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnadavbh12%2Fvq-vae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnadavbh12%2Fvq-vae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnadavbh12%2Fvq-vae/lists"}