{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/exemplar-vaes-for-exemplar-based-generation","title":"Exemplar VAE: Linking Generative Models, Nearest Neighbor Retrieval, and Data Augmentation","arxiv_id":"2004.04795","date":"2020-04-09","proceeding":"NeurIPS 2020 12","authors":["Sajad Norouzi","David J. Fleet","Mohammad Norouzi"],"abstract":"We introduce Exemplar VAEs, a family of generative models that bridge the gap between parametric and non-parametric, exemplar based generative models. Exemplar VAE is a variant of VAE with a non-parametric prior in the latent space based on a Parzen window estimator. To sample from it, one first draws a random exemplar from a training set, then stochastically transforms that exemplar into a latent code and a new observation. We propose retrieval augmented training (RAT) as a way to speed up Exemplar VAE training by using approximate nearest neighbor search in the latent space to define a lower bound on log marginal likelihood. To enhance generalization, model parameters are learned using exemplar leave-one-out and subsampling. Experiments demonstrate the effectiveness of Exemplar VAEs on density estimation and representation learning. Importantly, generative data augmentation using Exemplar VAEs on permutation invariant MNIST and Fashion MNIST reduces classification error from 1.17% to 0.69% and from 8.56% to 8.16%.","url_abs":"https://arxiv.org/abs/2004.04795v3","url_pdf":"https://arxiv.org/pdf/2004.04795v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"exemplar-vaes-for-exemplar-based-generation","repo_url":"https://github.com/sajadn/Exemplar-VAE","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"density-estimation","task_name":"Density Estimation"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2004.04795","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.04795"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/sajadn/Exemplar-VAE","reach":null}],"summary":{"ran":2,"ran_draft_wrong":4,"ran_violates":1,"unverified":4},"by_repo_kind":{"official":{"samples":11,"ran":7,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"83d5efafa2e9fa3d","entry":"NonLinear","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"83d5efafa2e9fa3d"}},{"code_sha256_prefix":"47a8f94603764f4a","entry":"log_bernoulli","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"47a8f94603764f4a"}},{"code_sha256_prefix":"e1f4cbecd2690e02","entry":"log_logistic_256","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e1f4cbecd2690e02"}},{"code_sha256_prefix":"731dd232f4b8579f","entry":"log_normal_diag","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"731dd232f4b8579f"}},{"code_sha256_prefix":"3efb45c64b1acc4f","entry":"log_normal_standard","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3efb45c64b1acc4f"}},{"code_sha256_prefix":"6ed5264974435fff","entry":"pairwise_distance","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6ed5264974435fff"}},{"code_sha256_prefix":"7c508037b40522af","entry":"str2bool","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"density_estimation.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/density_estimation.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7c508037b40522af"}},{"code_sha256_prefix":"be1641f21e463020","entry":"BaseHModel","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"be1641f21e463020"}},{"code_sha256_prefix":"cc1a45d6071c9a68","entry":"BaseModel","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cc1a45d6071c9a68"}},{"code_sha256_prefix":"2d62e9d56869c173","entry":"log_normal_diag_vectorized","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2d62e9d56869c173"}},{"code_sha256_prefix":"62618079bb543102","entry":"normal_init","repo":"sajadn/Exemplar-VAE","repo_kind":"official","path":"models/AbsHModel.py","file_url":"https://github.com/sajadn/Exemplar-VAE/blob/HEAD/models/AbsHModel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62618079bb543102"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}