{"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/learning-latent-space-energy-based-prior","title":"Learning Latent Space Energy-Based Prior Model","arxiv_id":"2006.08205","date":"2020-06-15","proceeding":"NeurIPS 2020 12","authors":["Bo Pang","Tian Han","Erik Nijkamp","Song-Chun Zhu","Ying Nian Wu"],"abstract":"We propose to learn energy-based model (EBM) in the latent space of a generator model, so that the EBM serves as a prior model that stands on the top-down network of the generator model. Both the latent space EBM and the top-down network can be learned jointly by maximum likelihood, which involves short-run MCMC sampling from both the prior and posterior distributions of the latent vector. Due to the low dimensionality of the latent space and the expressiveness of the top-down network, a simple EBM in latent space can capture regularities in the data effectively, and MCMC sampling in latent space is efficient and mixes well. We show that the learned model exhibits strong performances in terms of image and text generation and anomaly detection. The one-page code can be found in supplementary materials.","url_abs":"https://arxiv.org/abs/2006.08205v2","url_pdf":"https://arxiv.org/pdf/2006.08205v2.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":"learning-latent-space-energy-based-prior","repo_url":"https://github.com/bpucla/latent-space-EBM-prior","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"ebm","method_name":"EBM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2006.08205","atlas_url":"https://app.syntology.ai/?focus=2006.08205","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2006.08205"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/bpucla/latent-space-EBM-prior","reach":null}],"summary":{"ran":5,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"listed":{"samples":8,"ran":6,"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":"dcbaf6944f6d645a","entry":"GELU","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dcbaf6944f6d645a"}},{"code_sha256_prefix":"1238b0015976a0a9","entry":"Mish","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1238b0015976a0a9"}},{"code_sha256_prefix":"da8f7cc95b748c33","entry":"Swish","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"da8f7cc95b748c33"}},{"code_sha256_prefix":"8702b4b20711afd9","entry":"_netE","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8702b4b20711afd9"}},{"code_sha256_prefix":"169e5b8fb01ceb7a","entry":"_netWrapper","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"169e5b8fb01ceb7a"}},{"code_sha256_prefix":"e50f0da40636937b","entry":"get_activation","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e50f0da40636937b"}},{"code_sha256_prefix":"28b9ab25eaeb80d5","entry":"_netG","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.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":"28b9ab25eaeb80d5"}},{"code_sha256_prefix":"74ce9d0a6f6ef663","entry":"weights_init_xavier","repo":"bpucla/latent-space-EBM-prior","repo_kind":"listed","path":"train_celeba_128.py","file_url":"https://github.com/bpucla/latent-space-EBM-prior/blob/HEAD/train_celeba_128.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":"74ce9d0a6f6ef663"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}