{"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/bnnpriors-a-library-for-bayesian-neural","title":"BNNpriors: A library for Bayesian neural network inference with different prior distributions","arxiv_id":"2105.06964","date":"2021-05-14","proceeding":null,"authors":["Vincent Fortuin","Adrià Garriga-Alonso","Mark van der Wilk","Laurence Aitchison"],"abstract":"Bayesian neural networks have shown great promise in many applications where calibrated uncertainty estimates are crucial and can often also lead to a higher predictive performance. However, it remains challenging to choose a good prior distribution over their weights. While isotropic Gaussian priors are often chosen in practice due to their simplicity, they do not reflect our true prior beliefs well and can lead to suboptimal performance. Our new library, BNNpriors, enables state-of-the-art Markov Chain Monte Carlo inference on Bayesian neural networks with a wide range of predefined priors, including heavy-tailed ones, hierarchical ones, and mixture priors. Moreover, it follows a modular approach that eases the design and implementation of new custom priors. It has facilitated foundational discoveries on the nature of the cold posterior effect in Bayesian neural networks and will hopefully catalyze future research as well as practical applications in this area.","url_abs":"https://arxiv.org/abs/2105.06964v1","url_pdf":"https://arxiv.org/pdf/2105.06964v1.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":"bnnpriors-a-library-for-bayesian-neural","repo_url":"https://github.com/ratschlab/bnn_priors","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2105.06964","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.06964"}},"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/ratschlab/bnn_priors","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"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":"5e92d5908e69e5eb","entry":"DataDrivenMVTGoogleResNet","repo":"ratschlab/bnn_priors","repo_kind":"official","path":"bnn_priors/models/mvt_resnets.py","file_url":"https://github.com/ratschlab/bnn_priors/blob/HEAD/bnn_priors/models/mvt_resnets.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":"5e92d5908e69e5eb"}},{"code_sha256_prefix":"164fad7fde0d376e","entry":"LinearNealNormal","repo":"ratschlab/bnn_priors","repo_kind":"official","path":"bnn_priors/models/dense_nets.py","file_url":"https://github.com/ratschlab/bnn_priors/blob/HEAD/bnn_priors/models/dense_nets.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":"164fad7fde0d376e"}},{"code_sha256_prefix":"27e48eb779078e1a","entry":"collect_runs","repo":"ratschlab/bnn_priors","repo_kind":"official","path":"bnn_priors/notebook_utils.py","file_url":"https://github.com/ratschlab/bnn_priors/blob/HEAD/bnn_priors/notebook_utils.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":"27e48eb779078e1a"}},{"code_sha256_prefix":"f35c35e0ab818b93","entry":"device","repo":"ratschlab/bnn_priors","repo_kind":"official","path":"bnn_priors/exp_utils.py","file_url":"https://github.com/ratschlab/bnn_priors/blob/HEAD/bnn_priors/exp_utils.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":"f35c35e0ab818b93"}},{"code_sha256_prefix":"0529d320cd63ce5a","entry":"flatten","repo":"ratschlab/bnn_priors","repo_kind":"official","path":"bnn_priors/notebook_utils.py","file_url":"https://github.com/ratschlab/bnn_priors/blob/HEAD/bnn_priors/notebook_utils.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":"0529d320cd63ce5a"}},{"code_sha256_prefix":"34decb89bfa1acc6","entry":"unique_cols","repo":"ratschlab/bnn_priors","repo_kind":"official","path":"bnn_priors/notebook_utils.py","file_url":"https://github.com/ratschlab/bnn_priors/blob/HEAD/bnn_priors/notebook_utils.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":"34decb89bfa1acc6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}