SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1902.02476 · 2019

A Simple Baseline for Bayesian Uncertainty in Deep Learning

arXiv · PDF · Open in the Atlas

Code that ran

11 of 17 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; 1 honoured the contract we drafted, 2 violated it and 4 have no contract verdict; 4 failures of our instrument; 6 no recorded run), measured 2026-11-21; 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/1902.02476.json · badge: /api/ran/1902.02476.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
wjmaddox/swa_gaussian canonical (classifier label)
classifier basis: census
8 ran · 6 no recorded run
YeongHyeon/SWA-Gaussian-TF2 community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
adversarial_cross_entropy Ran
ran; our contract draft was wrong, not the code
wjmaddox/swa_gaussian/swag/losses.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("e11996f54eea8253")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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.

bayesian_sampling Ran
ran on a synthesized input
YeongHyeon/SWA-Gaussian-TF2/source/utils.py
code served (permissive licence) · get_code("b99c1d7b48976895")
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 ndarray, ndim 1, dtype family float, shape (4,) 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Construct theta_bank: a list of [swa, diag, dcol]
# swa: array of parameters (shape: 4,)
swa = np.array([1.0, 2.0, 3.0, 4.0])

# diag: diagonal terms (shape: 4,)
diag = np.array([0.5, 0.6, 0.7, 0.8])

# dcol: low-rank factor (shape: 3,)
dcol = np.array([0.1, 0.2, 0.3])

theta_bank = [swa, diag, dcol]

ARGS = {
    "theta_bank": theta_bank
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) 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
center_crop Ran
ran; our contract draft was wrong, not the code
wjmaddox/swa_gaussian/swag/models/layers.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("9d5555c9ff725b7f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
wjmaddox/swa_gaussian/swag/models/preresnet.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from amerch/CIFAR100-Training, is pointer only (licence: NONE) · get_code("583f9780bdd00a45")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from amerch/CIFAR100-Training, 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.

cross_entropy Ran
ran; our contract draft was wrong, not the code
wjmaddox/swa_gaussian/swag/losses.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("fc2aaf6fd20bc53f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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.

has_file_allowed_extension Ran
ran, violated the contract we drafted
wjmaddox/swa_gaussian/swag/camvid.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("1d7c68b369e70ab0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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.

is_image_file Ran
ran, violated the contract we drafted
wjmaddox/swa_gaussian/swag/camvid.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("af447e65a04b459e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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.

loaders Ran
ran on a synthesized input
wjmaddox/swa_gaussian/swag/data.py
code served (permissive licence) · get_code("9dc1a3ebe60f97ec")
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, 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 torchvision
import torchvision.transforms as transforms
import numpy as np

torch.manual_seed(0)

# Create minimal mock transforms
transform_train = transforms.Compose([
    transforms.ToTensor(),
])

transform_test = transforms.Compose([
    transforms.ToTensor(),
])

# Create a minimal mock dataset class for testing
class MockCIFAR10:
    def __init__(self, root, train=True, download=False, transform=None):
        self.root = root
        self.train = train
        self.transform = transform
        # Create mock data: 100 samples of 32x32 RGB images
        self.data = np.random.randint(0, 256, (100, 32, 32, 3), dtype=np.uint8)
        self.targets = [i % 10 for i in range(100)]
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        img = self.data[idx]
        target = self.targets[idx]
        if self.transform:
            img = self.transform(img)
        return img, target

# Patch torchvision.datasets to return our mock
original_cifar10 = torchvision.datasets.CIFAR10
torchvision.datasets.CIFAR10 = MockCIFAR10

ARGS = {
    'dataset': 'CIFAR10',
    'path': '/tmp/data',
    'batch_size': 2,
    'num_workers': 0,
    'transform_train': transform_train,
    'transform_test': transform_test,
    'use_validation': True,
    'val_size': 10,
    'split_classes': None,
    'shuffle_train': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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, 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
min_max_norm Ran
ran on a synthesized input
YeongHyeon/SWA-Gaussian-TF2/source/utils.py
code served (permissive licence) · get_code("bbf4ede63ece446f")
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 (2, 4) 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 to use as input
# The function calls x.min(), x.max(), and performs arithmetic operations
# so x needs to be a torch.Tensor
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 (2, 4) — shape (2, 4) 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
nll Ran
ran on a synthesized input
wjmaddox/swa_gaussian/experiments/ensembling/swa_ecdf_ensembles.py
code served (permissive licence) · get_code("3ccff5ae337f212a")
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 float32, 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 numpy as np

# Construct valid arguments for nll function
# The function expects:
# - outputs: a 2D array where outputs[i, j] gives probability of class j for sample i
# - labels: a 1D array of integer class labels

# Create small example data
batch_size = 2
num_classes = 4

# outputs should be a probability distribution (values between 0 and 1, summing to 1)
# We'll create a simple case with valid probabilities
outputs = np.array([
    [0.1, 0.2, 0.3, 0.4],  # sample 0: probabilities for classes 0,1,2,3
    [0.25, 0.25, 0.25, 0.25]  # sample 1: uniform probabilities
], dtype=np.float32)

# labels should be integer class indices
labels = np.array([2, 1], dtype=np.float32)  # sample 0 has label 2, sample 1 has label 1

ARGS = {
    "outputs": outputs,
    "labels": labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float32, 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
sorted_list Ran
ran, honoured the contract we drafted
YeongHyeon/SWA-Gaussian-TF2/source/utils.py
code served (permissive licence) · get_code("d68d9e1382bea360")
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 glob
import tempfile
import os

# Create a temporary directory with some test files
with tempfile.TemporaryDirectory() as tmpdir:
    # Create some test files with names that will sort in a predictable way
    test_files = ['file_c.txt', 'file_a.txt', 'file_b.txt']
    for fname in test_files:
        open(os.path.join(tmpdir, fname), 'w').close()
    
    # Create the path pattern for glob
    path_pattern = os.path.join(tmpdir, '*.txt')
    
    ARGS = {
        'path': path_pattern
    }
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 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
camvid_loaders Not yet run
unverified (harvested, no recorded run)
wjmaddox/swa_gaussian/swag/data.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("e1ae5ee1960f180e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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. No invocation recorded.

find_models Not yet run
unverified (harvested, no recorded run)
wjmaddox/swa_gaussian/experiments/ensembling/swa_ecdf_ensembles.py
code served (permissive licence) · get_code("28c6926bada96fe8")
How it ran

no invocation recorded.

loaders Not yet run
unverified (harvested, no recorded run)
wjmaddox/swa_gaussian/experiments/imagenet/data.py
code served (permissive licence) · get_code("99e3815602045644")
How it ran

no invocation recorded.

masked_loss Not yet run
unverified (harvested, no recorded run)
wjmaddox/swa_gaussian/swag/losses.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("8bbca7799326d580")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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. No invocation recorded.

schedule Not yet run
unverified (harvested, no recorded run)
wjmaddox/swa_gaussian/experiments/imagenet/run_swag_imagenet.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from framartin/lgv-geometric-transferability, is pointer only (licence: GPL-3.0) · get_code("7478bf872b01d269")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from framartin/lgv-geometric-transferability, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

svhn_loaders Not yet run
unverified (harvested, no recorded run)
wjmaddox/swa_gaussian/swag/data.py
code served (permissive licence) · get_code("d1432df89765a54c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 12 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 12 later) and 5 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
conv3x3 686 other papers
87 dated earlier, 5 the same month, 594 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
has_file_allowed_extension 17 other papers
1 dated earlier, 16 later
1612.06321 (2016-12)
Large-Scale Image Retrieval with Attentive Deep Local Features
1904.04717 (2019-04)
Label Propagation for Deep Semi-supervised Learning
1907.10830 (2019-07)
U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation
and 14 more not named here
is_image_file 11 other papers
1 dated earlier, 10 later
1812.10366 (2018-12)
A Poisson-Gaussian Denoising Dataset with Real Fluorescence Microscopy Images
1904.04717 (2019-04)
Label Propagation for Deep Semi-supervised Learning
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
and 8 more not named here
center_crop 4 other papers
1 dated earlier, 3 later
1611.09326 (2016-11)
The One Hundred Layers Tiramisu: Fully Convolutional DenseNets for Semantic Segmentation
2003.07069 (2020-03)
Self-Supervised Discovering of Interpretable Features for Reinforcement Learning
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
and 1 more not named here
adversarial_cross_entropy 2 other papers
2 later
2305.18887 (2023-05)
How Does Information Bottleneck Help Deep Learning?
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
cross_entropy 2 other papers
2 later
2305.18887 (2023-05)
How Does Information Bottleneck Help Deep Learning?
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
masked_loss 2 other papers
2 later
2305.18887 (2023-05)
How Does Information Bottleneck Help Deep Learning?
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
min_max_norm 2 other papers
1 dated earlier, 1 later
1505.05770 (2015-05)
Variational Inference with Normalizing Flows
2105.01601 (2021-05)
MLP-Mixer: An all-MLP Architecture for Vision
sorted_list 2 other papers
1 dated earlier, 1 later
1505.05770 (2015-05)
Variational Inference with Normalizing Flows
2105.01601 (2021-05)
MLP-Mixer: An all-MLP Architecture for Vision
camvid_loaders 1 other paper
1 later
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
loaders 1 other paper
1 later
2305.18887 (2023-05)
How Does Information Bottleneck Help Deep Learning?
schedule 1 other paper
1 later
2207.13129 (2022-07)
LGV: Boosting Adversarial Example Transferability from Large Geometric Vicinity

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

Repositories linked to this paper

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

Abstract

We propose SWA-Gaussian (SWAG), a simple, scalable, and general purpose approach for uncertainty representation and calibration in deep learning. Stochastic Weight Averaging (SWA), which computes the first moment of stochastic gradient descent (SGD) iterates with a modified learning rate schedule, has recently been shown to improve generalization in deep learning. With SWAG, we fit a Gaussian using the SWA solution as the first moment and a low rank plus diagonal covariance also derived from the SGD iterates, forming an approximate posterior distribution over neural network weights; we then sample from this Gaussian distribution to perform Bayesian model averaging. We empirically find that SWAG approximates the shape of the true posterior, in accordance with results describing the stationary distribution of SGD iterates. Moreover, we demonstrate that SWAG performs well on a wide variety of tasks, including out of sample detection, calibration, and transfer learning, in comparison to many popular alternatives including MC dropout, KFAC Laplace, SGLD, and temperature scaling.

For agents

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

get_harvested_code_for_paper("1902.02476")
get_code_for_paper("1902.02476")
have("1902.02476")

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

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

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

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

Connect an agent — have() is free.