SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1901.02731 · 2019

A Comprehensive guide to Bayesian Convolutional Neural Network with Variational Inference

arXiv · PDF · Open in the Atlas

Code that ran

14 of 14 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; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/1901.02731.json · badge: /api/ran/1901.02731.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
kumar-shridhar/PyTorch-BayesianCNN canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
Anou9531/Bayesian-CNN community (classifier label)
classifier basis: plan_row
4 ran · 0 no recorded run
Neronjust2017/BayesianCNN community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
pankajb64/bayescnn reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
acc Ran
ran; our contract draft was wrong, not the code
Anou9531/Bayesian-CNN/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from HKU-MedAI/bnn_uncertainty, is pointer only (licence: NONE) · get_code("65b687daec914418")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from HKU-MedAI/bnn_uncertainty, and GitHub detected no licence in that repository 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.

calculate_kl Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/metrics.py
code served (permissive licence) · get_code("c4d3857bfdddadee")
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 Tensor, 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

torch.manual_seed(0)

# Construct tiny tensors for KL divergence calculation
# The function expects mean and standard deviation tensors
# Shape: (2, 4) for batch size 2, dimension 4
mu_q = torch.randn(2, 4)
sig_q = torch.abs(torch.randn(2, 4)) + 0.1  # ensure positive
mu_p = torch.randn(2, 4)
sig_p = torch.abs(torch.randn(2, 4)) + 0.1  # ensure positive

ARGS = {
    "mu_q": mu_q,
    "sig_q": sig_q,
    "mu_p": mu_p,
    "sig_p": sig_p,
}
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 Tensor, 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
calculate_kl Ran
ran on a synthesized input
Anou9531/Bayesian-CNN/metrics.py
code served (permissive licence) · get_code("749608ddd92cebf0")
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 Tensor, 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

torch.manual_seed(0)

# The function calculate_kl takes 4 parameters: mu_p, sig_p, mu_q, sig_q
# All are used in tensor operations (torch.log, division, pow, sum)
# They should be tensors with compatible shapes for element-wise operations

# Create small tensors with shape (2, 4) for batch_size=2, dim=4
mu_p = torch.randn(2, 4)
sig_p = torch.abs(torch.randn(2, 4)) + 0.1  # ensure positive
mu_q = torch.randn(2, 4)
sig_q = torch.abs(torch.randn(2, 4)) + 0.1  # ensure positive

ARGS = {
    "mu_p": mu_p,
    "sig_p": sig_p,
    "mu_q": mu_q,
    "sig_q": sig_q,
}
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 Tensor, 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
create_synthetic_data Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/Mixtures/temp_gmm.py
code served (permissive licence) · get_code("62a807882f020f00")
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 Tensor, ndim 2, dtype family float, shape (6, 2) 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

torch.manual_seed(0)

# Analyze the function:
# - num_gaussians: int, number of gaussians (used in range and indexing means/vars)
# - num_features: int, dimensionality (used in assertions and torch.eye)
# - num_samples: int, total samples to generate (used in division)
# - means: list of lists, each inner list has num_features elements
# - vars: list of lists, each inner list has num_features elements

num_gaussians = 3
num_features = 2
num_samples = 6

means = [[1, 4], [5, 5], [2, -1]]
vars = [[0.1, 0.1], [0.05, 0.4], [0.5, 0.2]]

ARGS = {
    "num_gaussians": num_gaussians,
    "num_features": num_features,
    "num_samples": num_samples,
    "means": means,
    "vars": vars,
}
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 Tensor, ndim 2, dtype family float, shape (6, 2) — shape (6, 2) 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
distribution_selector Ran
ran; our contract draft was wrong, not the code
pankajb64/bayescnn/src/bayesiancnn/BBBdistributions.py
pointer only (licence: NONE) · get_code("aba995b7ba4b1672")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, pankajb64/bayescnn 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_beta Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/metrics.py
code served (permissive licence) · get_code("592922a4273cef0d")
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 float, 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 numpy as np

torch.manual_seed(0)

ARGS = {
    "batch_idx": 5,
    "m": 10,
    "beta_type": "Blundell",
    "epoch": 2,
    "num_epochs": 8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
get_sample Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/uncertainty_estimation.py
code served (permissive licence) · get_code("6b6f997bdbf99918")
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 tuple. 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
import numpy as np
from PIL import Image
import torchvision.transforms as transforms

torch.manual_seed(0)

# Create a minimal mock dataset for MNIST-style data
class MockMNISTDataset:
    def __init__(self):
        # Create small dummy data: 5 samples of 28x28 grayscale images
        self.data = torch.randint(0, 256, (5, 28, 28), dtype=torch.uint8)
        self.targets = torch.tensor([0, 1, 2, 3, 4])

# Create a minimal mock dataset for ImageFolder-style data
class MockImageDataset:
    def __init__(self):
        # Create mock samples list with (path, label) tuples
        # We won't actually use these paths since we avoid file I/O
        self.samples = [
            ("dummy_path_0.jpg", 0),
            ("dummy_path_1.jpg", 1),
            ("dummy_path_2.jpg", 2),
        ]

# Instantiate datasets
mnist_dataset = MockMNISTDataset()
image_dataset = MockImageDataset()

ARGS = {
    'dataset': mnist_dataset,
    'sample_type': 'mnist'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
get_uncertainty_per_batch Ran
ran; our contract draft was wrong, not the code
Anou9531/Bayesian-CNN/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
Anou9531/Bayesian-CNN/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
initiate_experiment Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/Mixtures/mixture_experiment.py
code served (permissive licence) · get_code("5f72d46f78c57ba0")
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 function. 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 sys
import os
import datetime
import contextlib
import tempfile

@contextlib.contextmanager
def print_to_logfile(file):

    class Logger:

        def __init__(self, file):
            self.terminal = sys.stdout
            self.log = file

        def write(self, message):
            self.terminal.write(message)
            self.log.write(message)

        def __getattr__(self, attr):
            return getattr(self.terminal, attr)
    logger = Logger(file)
    _stdout = sys.stdout
    sys.stdout = logger
    try:
        yield logger.log
    finally:
        sys.stdout = _stdout

def initiate_experiment(experiment):

    def decorator(*args, **kwargs):
        log_file_dir = 'experiments/mixtures/'
        log_file = log_file_dir + experiment.__name__ + '.txt'
        if not os.path.exists(log_file):
            os.makedirs(log_file_dir, exist_ok=True)
        with print_to_logfile(open(log_file, 'a')):
            print('Performing experiment:', experiment.__name__)
            print('Date-Time:', datetime.datetime.now())
            print('\n', end='')
            print('Args:', args)
            print('Kwargs:', kwargs)
            print('\n', end='')
            experiment(*args, **kwargs)
            print('\n\n', end='')
    return decorator


def dummy_experiment():
    """Dummy experiment function to pass to initiate_experiment"""
    print("Running dummy experiment")
    return None


ARGS = {
    'experiment': dummy_experiment
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
logmeanexp Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/utils.py
code served (permissive licence) · get_code("25d66479cebad409")
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 Tensor, 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

torch.manual_seed(0)

# Create a small tensor for testing
# Using shape (2, 4) - batch size 2, feature dim 4
x = torch.randn(2, 4)

# Test case 1: dim=None (default behavior)
ARGS = {
    "x": x,
    "dim": None,
    "keepdim": False,
}
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 Tensor, 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
lr_linear Ran
ran on a synthesized input
Neronjust2017/BayesianCNN/metrics.py
code served (permissive licence) · get_code("764cb9125f7ab709")
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 float, 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 numpy as np

torch.manual_seed(0)

ARGS = {
    "epoch_num": 5,
    "decay_start": 10,
    "total_epochs": 20,
    "start_value": 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
mse Ran
ran on a synthesized input
Neronjust2017/BayesianCNN/metrics.py
code served (permissive licence) · get_code("6c4f18c203fe16d2")
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 Tensor, 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.functional as F

torch.manual_seed(0)

# Create small tensors for outputs and targets
# Both should have the same shape for mse_loss
outputs = torch.randn(2, 4)  # batch_size=2, dim=4
targets = torch.randn(2, 4)  # batch_size=2, dim=4

ARGS = {
    "outputs": outputs,
    "targets": targets,
}
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 Tensor, 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
print_to_logfile Ran
ran on a synthesized input
kumar-shridhar/PyTorch-BayesianCNN/Mixtures/mixture_experiment.py
code served (permissive licence) · get_code("e622866e75cd2f4d")
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 _GeneratorContextManager. 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 sys
import tempfile
import contextlib

@contextlib.contextmanager
def print_to_logfile(file):

    class Logger:

        def __init__(self, file):
            self.terminal = sys.stdout
            self.log = file

        def write(self, message):
            self.terminal.write(message)
            self.log.write(message)

        def __getattr__(self, attr):
            return getattr(self.terminal, attr)
    logger = Logger(file)
    _stdout = sys.stdout
    sys.stdout = logger
    try:
        yield logger.log
    finally:
        sys.stdout = _stdout


class StringIOFile:
    def __init__(self):
        self.contents = []
    
    def write(self, message):
        self.contents.append(message)
    
    def flush(self):
        pass


mock_file = StringIOFile()

ARGS = {
    "file": mock_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _GeneratorContextManager — a _GeneratorContextManager output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _GeneratorContextManager 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

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
get_uncertainty_per_batch 2 other papers
2 dated earlier
1505.05424 (2015-05)
Weight Uncertainty in Neural Networks
1506.02557 (2015-06)
Variational Dropout and the Local Reparameterization Trick
get_uncertainty_per_image 2 other papers
2 dated earlier
1505.05424 (2015-05)
Weight Uncertainty in Neural Networks
1506.02557 (2015-06)
Variational Dropout and the Local Reparameterization Trick
acc 1 other paper
1 later
2310.16587 (2023-10)
Adaptive Uncertainty Estimation via High-Dimensional Testing on Latent Representations
lr_linear 1 other paper
1 dated earlier
1803.03764 (2018-03)
Variance Networks: When Expectation Does Not Meet Your Expectations

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-22.

Repositories linked to this paper

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

Abstract

Artificial Neural Networks are connectionist systems that perform a given task by learning on examples without having prior knowledge about the task. This is done by finding an optimal point estimate for the weights in every node. Generally, the network using point estimates as weights perform well with large datasets, but they fail to express uncertainty in regions with little or no data, leading to overconfident decisions. In this paper, Bayesian Convolutional Neural Network (BayesCNN) using Variational Inference is proposed, that introduces probability distribution over the weights. Furthermore, the proposed BayesCNN architecture is applied to tasks like Image Classification, Image Super-Resolution and Generative Adversarial Networks. The results are compared to point-estimates based architectures on MNIST, CIFAR-10 and CIFAR-100 datasets for Image CLassification task, on BSD300 dataset for Image Super Resolution task and on CIFAR10 dataset again for Generative Adversarial Network task. BayesCNN is based on Bayes by Backprop which derives a variational approximation to the true posterior. We, therefore, introduce the idea of applying two convolutional operations, one for the mean and one for the variance. Our proposed method not only achieves performances equivalent to frequentist inference in identical architectures but also incorporate a measurement for uncertainties and regularisation. It further eliminates the use of dropout in the model. Moreover, we predict how certain the model prediction is based on the epistemic and aleatoric uncertainties and empirically show how the uncertainty can decrease, allowing the decisions made by the network to become more deterministic as the training accuracy increases. Finally, we propose ways to prune the Bayesian architecture and to make it more computational and time effective.

For agents

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

get_harvested_code_for_paper("1901.02731")
get_code_for_paper("1901.02731")
have("1901.02731")

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

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

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

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

Connect an agent — have() is free.