{"id":18965378,"url":"https://github.com/sony/sqvae","last_synced_at":"2025-08-21T10:31:43.002Z","repository":{"id":38835894,"uuid":"496510229","full_name":"sony/sqvae","owner":"sony","description":"Pytorch implementation of stochastically quantized variational autoencoder (SQ-VAE)","archived":false,"fork":false,"pushed_at":"2022-07-20T08:01:14.000Z","size":162,"stargazers_count":187,"open_issues_count":1,"forks_count":23,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-08T08:21:16.461Z","etag":null,"topics":["bayesian","deep-generative-model","generative-model","gumbel-softmax","machine-learning","pytorch","vae","variational-autoencoder","vector-quantization","vq-vae"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sony.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":"2022-05-26T06:40:40.000Z","updated_at":"2025-04-02T06:44:52.000Z","dependencies_parsed_at":"2022-07-16T15:17:04.681Z","dependency_job_id":null,"html_url":"https://github.com/sony/sqvae","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sony/sqvae","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fsqvae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fsqvae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fsqvae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fsqvae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sony","download_url":"https://codeload.github.com/sony/sqvae/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sony%2Fsqvae/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271462985,"owners_count":24764078,"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-08-21T02:00:08.990Z","response_time":74,"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":["bayesian","deep-generative-model","generative-model","gumbel-softmax","machine-learning","pytorch","vae","variational-autoencoder","vector-quantization","vq-vae"],"created_at":"2024-11-08T14:29:07.688Z","updated_at":"2025-08-21T10:31:42.640Z","avatar_url":"https://github.com/sony.png","language":"Python","readme":"# SQ-VAE\nThis repository contains the official PyTorch implementation of **\"SQ-VAE: Variational Bayes on Discrete Representation with Self-annealed Stochastic Quantization\"** presented in ICML2022 (*[arXiv 2205.07547](https://arxiv.org/abs/2205.07547)*).\nPlease cite [[1](#citation)] in your work when using this code in your experiments.\n\n![](imgs/method.png)\n\n\u003e **Abstract:** One noted issue of vector-quantized variational autoencoder (VQ-VAE) is that the learned discrete representation uses only a fraction of the full capacity of the codebook, also known as codebook collapse. We hypothesize that the training scheme of VQ-VAE, which involves some carefully designed heuristics, underlies this issue. In this paper, we propose a new training scheme that extends the standard VAE via novel stochastic dequantization and quantization, called stochastically quantized variational autoencoder (SQ-VAE). In SQ-VAE, we observe a trend that the quantization is stochastic at the initial stage of the training but gradually converges toward a deterministic quantization, which we call self-annealing. Our experiments show that SQ-VAE improves codebook utilization without using common heuristics. Furthermore, we empirically show that SQ-VAE is superior to VAE and VQ-VAE in vision- and speech-related tasks.\n\n\n# Citation\n[1] Takida, Y., Shibuya, T., Liao, W., Lai, C., Ohmura, J., Uesaka, T., Murata, N., Takahashi S., Kumakura, T. and Mitsufuji, Y.,\n\"SQ-VAE: Variational Bayes on Discrete Representation with Self-annealed Stochastic Quantization,\"\n39th International Conference on Machine Learning.\n```\n@INPROCEEDINGS{takida2022sq-vae,\n    author={Takida, Yuhta and Shibuya, Takashi and Liao, WeiHsiang and Lai, Chieh-Hsin and Ohmura, Junki and Uesaka, Toshimitsu and Murata, Naoki and Takahashi, Shusuke and Kumakura, Toshiyuki and Mitsufuji, Yuki},\n    title={{SQ-VAE}: Variational Bayes on Discrete Representation with Self-annealed Stochastic Quantization},\n    booktitle={International Conference on Machine Learning},\n    year={2022},\n    }\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsony%2Fsqvae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsony%2Fsqvae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsony%2Fsqvae/lists"}