{"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/towards-bridging-the-performance-gaps-of","title":"Towards Bridging the Performance Gaps of Joint Energy-based Models","arxiv_id":"2209.07959","date":"2022-09-16","proceeding":"CVPR 2023 1","authors":["Xiulong Yang","Qing Su","Shihao Ji"],"abstract":"Can we train a hybrid discriminative-generative model within a single network? This question has recently been answered in the affirmative, introducing the field of Joint Energy-based Model (JEM), which achieves high classification accuracy and image generation quality simultaneously. Despite recent advances, there remain two performance gaps: the accuracy gap to the standard softmax classifier, and the generation quality gap to state-of-the-art generative models. In this paper, we introduce a variety of training techniques to bridge the accuracy gap and the generation quality gap of JEM. 1) We incorporate a recently proposed sharpness-aware minimization (SAM) framework to train JEM, which promotes the energy landscape smoothness and the generalizability of JEM. 2) We exclude data augmentation from the maximum likelihood estimate pipeline of JEM, and mitigate the negative impact of data augmentation to image generation quality. Extensive experiments on multiple datasets demonstrate that our SADA-JEM achieves state-of-the-art performances and outperforms JEM in image classification, image generation, calibration, out-of-distribution detection and adversarial robustness by a notable margin. Our code is available at https://github.com/sndnyang/SADAJEM.","url_abs":"https://arxiv.org/abs/2209.07959v2","url_pdf":"https://arxiv.org/pdf/2209.07959v2.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":"towards-bridging-the-performance-gaps-of","repo_url":"https://github.com/sndnyang/sadajem","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"adversarial-robustness","task_name":"Adversarial Robustness"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"sharpness-aware-minimization","method_name":"Sharpness-Aware Minimization"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2209.07959","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2209.07959"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sndnyang/sadajem","reach":{"status":"ok"}}],"summary":{"ran_honours":2,"unverified":4},"by_repo_kind":{"official":{"samples":5,"ran":1,"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":6,"samples":[{"code_sha256_prefix":"d9a9c0f7abb58719","entry":"init_random","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"d9a9c0f7abb58719"}},{"code_sha256_prefix":"9c46250b2c46c1d6","entry":"init_random_uniform","repo":"sndnyang/sadajem","repo_kind":"official","path":"train_sadajem.py","file_url":"https://github.com/sndnyang/sadajem/blob/HEAD/train_sadajem.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":"9c46250b2c46c1d6"}},{"code_sha256_prefix":"0c18472ec2198141","entry":"init_from_centers","repo":"sndnyang/sadajem","repo_kind":"official","path":"eval_sadajem.py","file_url":"https://github.com/sndnyang/sadajem/blob/HEAD/eval_sadajem.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0c18472ec2198141"}},{"code_sha256_prefix":"d1969cfef3c43014","entry":"init_inform","repo":"sndnyang/sadajem","repo_kind":"official","path":"eval_sadajem.py","file_url":"https://github.com/sndnyang/sadajem/blob/HEAD/eval_sadajem.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d1969cfef3c43014"}},{"code_sha256_prefix":"6d7042c0cb9be0d6","entry":"init_random","repo":"sndnyang/sadajem","repo_kind":"official","path":"train_sadajem.py","file_url":"https://github.com/sndnyang/sadajem/blob/HEAD/train_sadajem.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6d7042c0cb9be0d6"}},{"code_sha256_prefix":"e69a819f5b2d3e0c","entry":"sample_p_0","repo":"sndnyang/sadajem","repo_kind":"official","path":"train_sadajem.py","file_url":"https://github.com/sndnyang/sadajem/blob/HEAD/train_sadajem.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e69a819f5b2d3e0c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}