{"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/your-gan-is-secretly-an-energy-based-model","title":"Your GAN is Secretly an Energy-based Model and You Should use Discriminator Driven Latent Sampling","arxiv_id":"2003.06060","date":"2020-03-12","proceeding":"NeurIPS 2020 12","authors":["Tong Che","Ruixiang Zhang","Jascha Sohl-Dickstein","Hugo Larochelle","Liam Paull","Yuan Cao","Yoshua Bengio"],"abstract":"We show that the sum of the implicit generator log-density $\\log p_g$ of a GAN with the logit score of the discriminator defines an energy function which yields the true data density when the generator is imperfect but the discriminator is optimal, thus making it possible to improve on the typical generator (with implicit density $p_g$). To make that practical, we show that sampling from this modified density can be achieved by sampling in latent space according to an energy-based model induced by the sum of the latent prior log-density and the discriminator output score. This can be achieved by running a Langevin MCMC in latent space and then applying the generator function, which we call Discriminator Driven Latent Sampling~(DDLS). We show that DDLS is highly efficient compared to previous methods which work in the high-dimensional pixel space and can be applied to improve on previously trained GANs of many types. We evaluate DDLS on both synthetic and real-world datasets qualitatively and quantitatively. On CIFAR-10, DDLS substantially improves the Inception Score of an off-the-shelf pre-trained SN-GAN~\\citep{sngan} from $8.22$ to $9.09$ which is even comparable to the class-conditional BigGAN~\\citep{biggan} model. This achieves a new state-of-the-art in unconditional image synthesis setting without introducing extra parameters or additional training.","url_abs":"https://arxiv.org/abs/2003.06060v3","url_pdf":"https://arxiv.org/pdf/2003.06060v3.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":"your-gan-is-secretly-an-energy-based-model","repo_url":"https://github.com/Daniil-Selikhanovych/ebm-wgan","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"your-gan-is-secretly-an-energy-based-model","repo_url":"https://github.com/JHpark1677/CGAN-DDLS","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"your-gan-is-secretly-an-energy-based-model","repo_url":"https://github.com/ramonpeter/LaSeR","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2003.06060","atlas_url":"https://app.syntology.ai/?focus=2003.06060","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2003.06060"}},"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/JHpark1677/CGAN-DDLS","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Daniil-Selikhanovych/ebm-wgan","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ramonpeter/LaSeR","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":3,"unverified":2},"by_repo_kind":{"listed":{"samples":5,"ran":3,"repositories":2}},"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":3,"samples":[{"code_sha256_prefix":"438bcd0a1ba99d17","entry":"Langevin_sampling","repo":"Daniil-Selikhanovych/ebm-wgan","repo_kind":"listed","path":"api/ebm_sampling.py","file_url":"https://github.com/Daniil-Selikhanovych/ebm-wgan/blob/HEAD/api/ebm_sampling.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"438bcd0a1ba99d17"}},{"code_sha256_prefix":"d5e920b3e7544980","entry":"MALA_sampling","repo":"Daniil-Selikhanovych/ebm-wgan","repo_kind":"listed","path":"api/ebm_sampling.py","file_url":"https://github.com/Daniil-Selikhanovych/ebm-wgan/blob/HEAD/api/ebm_sampling.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d5e920b3e7544980"}},{"code_sha256_prefix":"32369b999c744730","entry":"calculate_energy","repo":"Daniil-Selikhanovych/ebm-wgan","repo_kind":"listed","path":"api/ebm_sampling.py","file_url":"https://github.com/Daniil-Selikhanovych/ebm-wgan/blob/HEAD/api/ebm_sampling.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"32369b999c744730"}},{"code_sha256_prefix":"8a98b258e2730b4d","entry":"Loader","repo":"ramonpeter/LaSeR","repo_kind":"listed","path":"load_data.py","file_url":"https://github.com/ramonpeter/LaSeR/blob/HEAD/load_data.py","link_basis":"harvester_set","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":"8a98b258e2730b4d"}},{"code_sha256_prefix":"1128b0cc9e6d1a73","entry":"read_files","repo":"ramonpeter/LaSeR","repo_kind":"listed","path":"load_data.py","file_url":"https://github.com/ramonpeter/LaSeR/blob/HEAD/load_data.py","link_basis":"harvester_set","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":"1128b0cc9e6d1a73"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}