{"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/training-binary-neural-networks-using-the","title":"Training Binary Neural Networks using the Bayesian Learning Rule","arxiv_id":"2002.10778","date":"2020-02-25","proceeding":"ICML 2020 1","authors":["Xiangming Meng","Roman Bachmann","Mohammad Emtiyaz Khan"],"abstract":"Neural networks with binary weights are computation-efficient and hardware-friendly, but their training is challenging because it involves a discrete optimization problem. Surprisingly, ignoring the discrete nature of the problem and using gradient-based methods, such as the Straight-Through Estimator, still works well in practice. This raises the question: are there principled approaches which justify such methods? In this paper, we propose such an approach using the Bayesian learning rule. The rule, when applied to estimate a Bernoulli distribution over the binary weights, results in an algorithm which justifies some of the algorithmic choices made by the previous approaches. The algorithm not only obtains state-of-the-art performance, but also enables uncertainty estimation for continual learning to avoid catastrophic forgetting. Our work provides a principled approach for training binary neural networks which justifies and extends existing approaches.","url_abs":"https://arxiv.org/abs/2002.10778v4","url_pdf":"https://arxiv.org/pdf/2002.10778v4.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":"training-binary-neural-networks-using-the","repo_url":"https://github.com/team-approx-bayes/BayesBiNN","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"training-binary-neural-networks-using-the","repo_url":"https://github.com/intellhave/adaste","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"training-binary-neural-networks-using-the","repo_url":"https://github.com/mengxiangming/BayesBiNN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"training-binary-neural-networks-using-the","repo_url":"https://github.com/prateekstark/training-binary-neural-network","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"continual-learning","task_name":"Continual Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2002.10778","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2002.10778"}},"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/team-approx-bayes/BayesBiNN","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/tajanthan/pmf","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mengxiangming/BayesBiNN","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/intellhave/adaste","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/prateekstark/training-binary-neural-network","reach":null}],"summary":{"ran":2,"ran_violates":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":2,"ran":2,"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":"20216d8cd6d7ca30","entry":"BayesBiNN","repo":"intellhave/adaste","repo_kind":"listed","path":"optimizers/BayesBiNN.py","file_url":"https://github.com/intellhave/adaste/blob/HEAD/optimizers/BayesBiNN.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"20216d8cd6d7ca30"}},{"code_sha256_prefix":"3949eced82034daa","entry":"BiNNOptimizer","repo":"prateekstark/training-binary-neural-network","repo_kind":"listed","path":"BayesBiNN/optim.py","file_url":"https://github.com/prateekstark/training-binary-neural-network/blob/HEAD/BayesBiNN/optim.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3949eced82034daa"}},{"code_sha256_prefix":"a41e9e5f323535d3","entry":"timeSince","repo":"team-approx-bayes/bayesbinn","repo_kind":"official","path":"main_mnist.py","file_url":"https://github.com/team-approx-bayes/bayesbinn/blob/HEAD/main_mnist.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a41e9e5f323535d3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}