SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1505.05424 · 2015

Weight Uncertainty in Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

12 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 3 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/1505.05424.json · badge: /api/ran/1505.05424.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
saxena-mayur/Weight-Uncertainty-in-Neural-Networks reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
yliess86/Bayeformers extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
liqichen6688/baycnn reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
czgdp1807/bayesiandl reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
danielkelshaw/RadialBNN extension (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
beauCoker/bayesian_neural_networks reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
IntelLabs/bayesian-torch extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
SulemanKhurram/ThesisExperiments reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
dic2cuda Ran
ran; our contract draft was wrong, not the code
yliess86/Bayeformers/examples/bert_glue.py
code served (permissive licence) · get_code("546da61322f2938c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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)

# Create a dictionary with various types of values including tensors
dic = {
    'tensor1': torch.randn(2, 4),
    'tensor2': torch.randn(3, 5),
    'scalar': 42,
    'string': 'hello',
    'list': [1, 2, 3],
    'nested_dict': {'a': 1, 'b': 2}
}

device = 'cpu'

ARGS = {
    'dic': dic,
    'device': device
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
gaussian Ran
ran; our contract draft was wrong, not the code
saxena-mayur/Weight-Uncertainty-in-Neural-Networks/FCN_Image_Classification/BBB.py
pointer only (licence: NONE) · get_code("e0552067b0269afd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, saxena-mayur/Weight-Uncertainty-in-Neural-Networks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_activation Ran
ran; our contract draft was wrong, not the code
beauCoker/bayesian_neural_networks/src/variational_bnns.py
pointer only (licence: NONE) · get_code("fe8746a4dd93bc88")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, beauCoker/bayesian_neural_networks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_uncertainty_per_batch Ran
ran; our contract draft was wrong, not the code
liqichen6688/baycnn/uncertainty_estimation.py
code served (permissive licence) · get_code("dd46eb517cc22519")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 3, dtype family float; no output shape is stated. 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 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 torch
import numpy as np
from torch import nn
from torch.nn import functional as F

torch.manual_seed(0)

class StandInModel(nn.Module):
    def __init__(self, in_channels=3, num_classes=5):
        super().__init__()
        self.conv = nn.Conv2d(in_channels, 8, kernel_size=3, padding=1)
        self.fc = nn.Linear(8 * 4 * 4, num_classes)
        
    def forward(self, x):
        # x shape: (batch, channels, height, width)
        out = self.conv(x)
        out = F.relu(out)
        out = out.view(out.size(0), -1)
        out = self.fc(out)
        # Return tuple (net_out, something_else)
        return out, None

model = StandInModel(in_channels=3, num_classes=5)
model.eval()

# Create a small batch: (batch_size=2, channels=3, height=4, width=4)
batch = torch.randn(2, 3, 4, 4)

ARGS = {
    'model': model,
    'batch': batch,
    'T': 15,
    'normalized': False
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple 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
get_uncertainty_per_image Ran
ran; our contract draft was wrong, not the code
liqichen6688/baycnn/uncertainty_estimation.py
code served (permissive licence) · get_code("3698e0abeea9d5d0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 2, 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class StandInModel(nn.Module):
    def __init__(self, in_channels=3, num_classes=5):
        super().__init__()
        self.conv = nn.Conv2d(in_channels, 8, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((1, 1))
        self.fc = nn.Linear(8, num_classes)
        self.dropout = nn.Dropout(0.5)
        
    def forward(self, x):
        # x shape: (batch, channels, height, width)
        x = self.conv(x)
        x = self.dropout(x)
        x = self.pool(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        # Return tuple (output, dummy_value) as expected by the function
        return x, None

model = StandInModel(in_channels=3, num_classes=5)
model.train()  # Enable dropout for uncertainty estimation

# Create a small input image: (channels, height, width)
input_image = torch.randn(3, 8, 8)

ARGS = {
    'model': model,
    'input_image': input_image,
    'T': 15,
    'normalized': False
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple 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
is_module_bayesian Ran
ran, violated the contract we drafted
yliess86/Bayeformers/bayeformers/nn/model.py
code served (permissive licence) · get_code("fb0cb1ed76593741")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
import torch.nn as nn

torch.manual_seed(0)

# Create a Bayesian module (has both log_prior and log_variational_posterior)
class BayesianModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, 3))
    
    def log_prior(self):
        return torch.tensor(0.0)
    
    def log_variational_posterior(self):
        return torch.tensor(0.0)
    
    def forward(self, x):
        return x @ self.weight.t()

# Create a non-Bayesian module (standard module without those methods)
class NonBayesianModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, 3))
    
    def forward(self, x):
        return x @ self.weight.t()

# Use the Bayesian module for the test
bayesian_module = BayesianModule()

ARGS = {
    'module': bayesian_module
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
log_gaussian Ran
ran, honoured the contract we drafted
saxena-mayur/Weight-Uncertainty-in-Neural-Networks/FCN_Image_Classification/BBB.py
pointer only (licence: NONE) · get_code("d0dfc3df96e8289c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, saxena-mayur/Weight-Uncertainty-in-Neural-Networks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

mixture_prior Ran
ran; our contract draft was wrong, not the code
saxena-mayur/Weight-Uncertainty-in-Neural-Networks/FCN_Image_Classification/BBB.py
pointer only (licence: NONE) · get_code("ce7244d7dca4ff4f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, saxena-mayur/Weight-Uncertainty-in-Neural-Networks when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

random_shuffle Ran
ran, honoured the contract we drafted
czgdp1807/bayesiandl/train/bnn_mnist.py
pointer only (licence: NONE) · get_code("e401f74c2731c8dc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, czgdp1807/bayesiandl when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

take_subset Ran
ran; our contract draft was wrong, not the code
czgdp1807/bayesiandl/train/bnn_mnist.py
pointer only (licence: NONE) · get_code("46fa14942323b489")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, czgdp1807/bayesiandl when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

test Ran
ran, honoured the contract we drafted
danielkelshaw/RadialBNN/mnist_radial_bnn.py
code served (permissive licence) · get_code("bdea437fe2c544f2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, 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 torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import TensorDataset, DataLoader

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc = nn.Linear(12, 5)  # input features: 12, output classes: 5
    
    def forward(self, x):
        # Flatten input if needed
        x = x.view(x.size(0), -1)
        return self.fc(x)

model = SimpleModel()

# Create test data
# Using batch size 2, 3 channels, 2x2 spatial dimensions = 12 features total
test_data = torch.randn(6, 3, 2, 2)  # 6 samples
test_labels = torch.randint(0, 5, (6,))  # 5 classes

# Create dataset and dataloader
test_dataset = TensorDataset(test_data, test_labels)
testloader = DataLoader(test_dataset, batch_size=2, shuffle=False)

device = torch.device('cpu')

ARGS = {
    'model': model,
    'testloader': testloader,
    'device': device
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
validate Ran
ran, honoured the contract we drafted
IntelLabs/bayesian-torch/bayesian_torch/examples/main_bayesian_cifar.py
code served (permissive licence) · get_code("dc1056d38a46ffbd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. 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, ndim and shape 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
import torch.nn as nn
import torch.utils.data
from collections import namedtuple

torch.manual_seed(0)

# Create a simple model that returns output and kl
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc = nn.Linear(12, 5)  # 5 classes
    
    def forward(self, x):
        # Flatten input
        x = x.view(x.size(0), -1)
        output = self.fc(x)
        # Return output and a scalar KL divergence
        kl = torch.tensor(0.1)
        return output, kl
    
    def eval(self):
        self.training = False
        return self

model = SimpleModel()

# Create a simple criterion (cross entropy loss)
criterion = nn.CrossEntropyLoss()

# Create a simple validation dataset
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self):
        self.data = torch.randn(4, 3, 2, 2)  # 4 samples, 3 channels, 2x2 images
        self.targets = torch.tensor([0, 1, 2, 3])  # 4 classes (out of 5 possible)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

dataset = SimpleDataset()
val_loader = torch.utils.data.DataLoader(dataset, batch_size=2, shuffle=False)

# Create args object with all necessary attributes
class Args:
    def __init__(self):
        self.half = False
        self.num_mc = 2  # Number of Monte Carlo runs
        self.batch_size = 2
        self.print_freq = 1

args = Args()

epoch = 0

tb_writer = None

ARGS = {
    'args': args,
    'val_loader': val_loader,
    'model': model,
    'criterion': criterion,
    'epoch': epoch,
    'tb_writer': tb_writer
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
accuracy Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from snu-mllab/PuzzleMix
pointer only · get_code("f0c9a29156911331")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

data_parallel Not yet run
unverified (harvested, no recorded run)
SulemanKhurram/ThesisExperiments/utils/BayesianDataParallel/BBBDataParallel.py
code served (permissive licence) · get_code("36bcc73ea59ec42b")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
danielkelshaw/RadialBNN/mnist_radial_bnn.py
code served (permissive licence) · get_code("5cc87715e60867cd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 8 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 7 later) and 7 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
accuracy 71 other papers
71 later · 2 only as an assembly brick
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1802.10399 (2018-02)
Compressing Neural Networks using the Variational Information Bottleneck
1802.10419 (2018-02)
Convolutional Neural Networks with Alternately Updated Clique
and 68 more not named here
data_parallel 9 other papers
9 later
1603.00831 (2016-03)
MOT16: A Benchmark for Multi-Object Tracking
1808.01244 (2018-08)
CornerNet: Detecting Objects as Paired Keypoints
1901.08043 (2019-01)
Bottom-up Object Detection by Grouping Extreme and Center Points
and 6 more not named here
get_activation 2 other papers
2 later
1703.01961 (2017-03)
Multiplicative Normalizing Flows for Variational Bayesian Neural Networks
1711.01297 (2017-11)
Implicit Weight Uncertainty in Neural Networks
get_uncertainty_per_batch 2 other papers
2 later
1506.02557 (2015-06)
Variational Dropout and the Local Reparameterization Trick
1901.02731 (2019-01)
A Comprehensive guide to Bayesian Convolutional Neural Network with Variational Inference
get_uncertainty_per_image 2 other papers
2 later
1506.02557 (2015-06)
Variational Dropout and the Local Reparameterization Trick
1901.02731 (2019-01)
A Comprehensive guide to Bayesian Convolutional Neural Network with Variational Inference
log_gaussian 1 other paper
1 dated earlier
1312.6114 (2013-12)
Auto-Encoding Variational Bayes
test 1 other paper
1 later
1907.00865 (2019-07)
Radial Bayesian Neural Networks: Beyond Discrete Support In Large-Scale Bayesian Deep Learning
train 1 other paper
1 later
1907.00865 (2019-07)
Radial Bayesian Neural Networks: Beyond Discrete Support In Large-Scale Bayesian Deep Learning

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

More are linked than shown here.

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

Abstract

We introduce a new, efficient, principled and backpropagation-compatible algorithm for learning a probability distribution on the weights of a neural network, called Bayes by Backprop. It regularises the weights by minimising a compression cost, known as the variational free energy or the expected lower bound on the marginal likelihood. We show that this principled kind of regularisation yields comparable performance to dropout on MNIST classification. We then demonstrate how the learnt uncertainty in the weights can be used to improve generalisation in non-linear regression problems, and how this weight uncertainty can be used to drive the exploration-exploitation trade-off in reinforcement learning.

For agents

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

get_harvested_code_for_paper("1505.05424")
get_code_for_paper("1505.05424")
have("1505.05424")

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

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

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

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

Connect an agent — have() is free.