SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.06964 · 2021

BNNpriors: A library for Bayesian neural network inference with different prior distributions

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2105.06964.json · badge: /api/ran/2105.06964.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ratschlab/bnn_priors canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
collect_runs Ran
ran; our contract draft was wrong, not the code
ratschlab/bnn_priors/bnn_priors/notebook_utils.py
code served (permissive licence) · get_code("27e48eb779078e1a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os
import json
from pathlib import Path
import pandas as pd

# Create a temporary directory structure for the function
temp_dir = tempfile.mkdtemp()
base_log_dir = Path(temp_dir)

# Create a couple of run directories with necessary files
run1_dir = base_log_dir / "run_001"
run1_dir.mkdir(exist_ok=True)

run2_dir = base_log_dir / "run_002"
run2_dir.mkdir(exist_ok=True)

# Create config.json for run_001
config1 = {
    "model": {
        "hidden_size": 64,
        "num_layers": 2
    },
    "learning_rate": 0.001,
    "batch_size": 32
}
with open(run1_dir / "config.json", "w") as f:
    json.dump(config1, f)

# Create run.json for run_001
run1 = {
    "epoch": 10,
    "loss": {
        "train": 0.5,
        "val": 0.6
    },
    "accuracy": 0.95
}
with open(run1_dir / "run.json", "w") as f:
    json.dump(run1, f)

# Create metrics.h5 placeholder for run_001
with open(run1_dir / "metrics.h5", "w") as f:
    f.write("")

# Create config.json for run_002
config2 = {
    "model": {
        "hidden_size": 128,
        "num_layers": 3
    },
    "learning_rate": 0.0001,
    "batch_size": 16
}
with open(run2_dir / "config.json", "w") as f:
    json.dump(config2, f)

# Create run.json for run_002
run2 = {
    "epoch": 5,
    "loss": {
        "train": 0.3,
        "val": 0.4
    },
    "accuracy": 0.97
}
with open(run2_dir / "run.json", "w") as f:
    json.dump(run2, f)

# Create metrics.h5 placeholder for run_002
with open(run2_dir / "metrics.h5", "w") as f:
    f.write("")

ARGS = {
    "base_log_dir": str(base_log_dir),
    "metrics_must_exist": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
device Ran
ran; our contract draft was wrong, not the code · constructed an object; no result was computed
ratschlab/bnn_priors/bnn_priors/exp_utils.py
code served (permissive licence) · get_code("f35c35e0ab818b93")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, device: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch as t

t.manual_seed(0)

ARGS = {
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type device — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a device output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
flatten Ran
ran; our contract draft was wrong, not the code
ratschlab/bnn_priors/bnn_priors/notebook_utils.py
code served (permissive licence) · get_code("0529d320cd63ce5a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function `flatten` takes a dictionary and recursively flattens nested dicts
# by concatenating keys with dots. It only needs one parameter: in_dict

# Create a nested dictionary structure to test the flatten function
nested_dict = {
    'a': 1,
    'b': 2,
    'c': {
        'd': 3,
        'e': 4,
        'f': {
            'g': 5,
            'h': 6
        }
    },
    'i': 'value',
    'j': {
        'k': [1, 2, 3],
        'l': {'m': 7}
    }
}

ARGS = {
    'in_dict': nested_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unique_cols Ran
ran; our contract draft was wrong, not the code
ratschlab/bnn_priors/bnn_priors/notebook_utils.py
code served (permissive licence) · get_code("34decb89bfa1acc6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create a minimal DataFrame with some columns
df = pd.DataFrame({
    'col_constant': [1, 1],
    'col_varying': [1, 2],
    'heartbeat': [0, 0],
    'log_dir': ['/path', '/path'],
    'run_id': ['id1', 'id2'],
    'meta.options.param1': [10, 10],
    'meta.options.param2': [20, 30],
    'result.acc_last': [0.9, 0.91],
    'result.loss': [0.1, 0.2],
    'another_varying': ['a', 'b'],
    'another_constant': ['x', 'x'],
})

blacklist = set(['heartbeat', 'log_dir', 'run_id', 'host.cpu', 'host.gpus.driver_version', 'host.hostname', 'host.python_version', 'start_time', 'status', 'stop_time', 'the_dir', 'result.acc_last', 'result.acc_mean', 'result.acc_std', 'result.acc_stderr', 'result.lp_ensemble', 'result.lp_ensemble_std', 'result.lp_ensemble_stderr', 'result.lp_last', 'result.lp_mean', 'result.lp_std', 'result.lp_stderr'])

ARGS = {
    'df': df,
    'blacklist': blacklist,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DataDrivenMVTGoogleResNet Not yet run
unverified (harvested, no recorded run)
ratschlab/bnn_priors/bnn_priors/models/mvt_resnets.py
code served (permissive licence) · get_code("5e92d5908e69e5eb")
How it ran

no invocation recorded.

LinearNealNormal Not yet run
unverified (harvested, no recorded run)
ratschlab/bnn_priors/bnn_priors/models/dense_nets.py
code served (permissive licence) · get_code("164fad7fde0d376e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
collect_runs 1 other paper
1 later
2203.16481 (2022-03)
On Uncertainty, Tempering, and Data Augmentation in Bayesian Classification
device 1 other paper
1 later
2203.16481 (2022-03)
On Uncertainty, Tempering, and Data Augmentation in Bayesian Classification
flatten 1 other paper
1 later
2203.16481 (2022-03)
On Uncertainty, Tempering, and Data Augmentation in Bayesian Classification
unique_cols 1 other paper
1 later
2203.16481 (2022-03)
On Uncertainty, Tempering, and Data Augmentation in Bayesian Classification

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2105.06964")
get_code_for_paper("2105.06964")
have("2105.06964")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2105.06964.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2105.06964.svg)](https://syntology.ai/paper/2105.06964)

Connect an agent — have() is free.