SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.05757 · 2024

Temperature Optimization for Bayesian Deep Learning

arXiv · PDF · Open in the Atlas

Code that ran

11 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 9 failures of our instrument; 4 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/2410.05757.json · badge: /api/ran/2410.05757.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
weiyaw/tempered-posteriors canonical (classifier label)
classifier basis: census
11 ran · 4 no recorded run
FunctionStatusWhere it lives
add_classficiation Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/datasets/download_data.py
code served (permissive licence) · get_code("9b436ef2d0792040")
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 ClassificationDataset. 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)

class ClassificationDataset:
    """Minimal stand-in class for a classification dataset."""
    def __init__(self, name):
        self.name = name

# Create a simple classification dataset object
dataset = ClassificationDataset(name="test_dataset")

# Define ARGS mapping the parameter to the value
ARGS = {
    "C": dataset
}
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 ClassificationDataset — a ClassificationDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ClassificationDataset 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
add_regression Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/datasets/download_data.py
code served (permissive licence) · get_code("5cadf1fc3261f6c0")
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 RegressionDataset. 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
import torch.nn as nn

torch.manual_seed(0)

class RegressionDataset:
    def __init__(self):
        self.name = "test_regression_dataset"

C = RegressionDataset()

ARGS = {
    "C": C
}
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 RegressionDataset — a RegressionDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RegressionDataset 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
filter_args Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/inference.py
code served (permissive licence) · get_code("52941c123cdcadee")
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 inspect
import torch

def dummy_fn(x, y, z=10):
    """A simple function to filter arguments for."""
    return x + y + z

def another_fn(a, b):
    """Another function with different signature."""
    return a * b

# Set seed for reproducibility
torch.manual_seed(0)

# Create test arguments dictionary with various keys
args_dict = {
    'x': torch.tensor([1.0, 2.0, 3.0, 4.0]),
    'y': torch.tensor([5.0, 6.0, 7.0, 8.0]),
    'z': 20,
    'extra_param': 'should_be_filtered',
    'another_extra': 42,
}

# Create a simple test function
def test_function(x, y, z=10):
    return x + y + z

ARGS = {
    'args_dict': args_dict,
    'fn': test_function,
    'exclude': []
}
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 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
flatdict Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/main-empirical.py
code served (permissive licence) · get_code("ad3ede600b6e930f")
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 str. 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 flatdict takes a parameter 'x' and:
# - Returns '' if x is None
# - Otherwise calls x.values() and joins string representations with ','
# So x must be a dict-like object with a .values() method

# Test case 1: x is a dict with some values
test_dict = {
    'key1': 42,
    'key2': 3.14,
    'key3': 'hello'
}

ARGS = {
    'x': test_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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
is_numeric Ran
ran, violated the contract we drafted
weiyaw/tempered-posteriors/training.py
code served (permissive licence) · get_code("0d4d5d0d375201d6")
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 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 numpy as np

def is_numeric(x):
    try:
        float(x)
        return True
    except ValueError:
        return False

# The function is_numeric takes a single parameter x and attempts to convert it to float
# It returns True if successful, False if ValueError is raised
# We need to test with various types that can be converted to float

ARGS = {
    "x": 42
}
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 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_prob_tree Ran
ran, honoured the contract we drafted
weiyaw/tempered-posteriors/training.py
code served (permissive licence) · get_code("2afc2e44e4aa1fe0")
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 ArrayImpl, 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 jax
import jax.numpy as jnp
import chex
import distrax

# Create a simple scalar distribution
dist = distrax.Normal(loc=0.0, scale=1.0)

# Create a pytree of samples from the distribution
# The function expects tree_z to be a pytree that can be tree_reduced
# We'll create a nested structure with arrays
tree_z = {
    'a': jnp.array([0.5, -0.3, 1.2, 0.1]),
    'b': {
        'c': jnp.array([0.2, -0.5]),
        'd': jnp.array([1.5])
    }
}

ARGS = {
    'tree_z': tree_z,
    'dist': dist
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
chex, distrax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
make_constant_lr_schedule_with_cosine_burnin Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/sgmcmc.py
code served (permissive licence) · get_code("1910403f272fdc73")
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 jax.numpy as jnp
import numpy as np

# Simple setup for the learning rate schedule function
init_lr = 0.1
final_lr = 0.01
burnin_steps = 100

ARGS = {
    "init_lr": init_lr,
    "final_lr": final_lr,
    "burnin_steps": burnin_steps,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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
make_cosine_schedule Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/sgmcmc.py
code served (permissive licence) · get_code("013661d041de5d86")
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 optax

torch_imported = False
try:
    import torch
    torch_imported = True
    torch.manual_seed(0)
except ImportError:
    pass

ARGS = {
    "init_lr": 0.001,
    "total_steps": 1000,
    "final_lr": 0.0001,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
optax, torch — 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
normalize Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/datasets/download_data.py
code served (permissive licence) · get_code("cba0faabe1fa7dc7")
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. 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 numpy as np

# Create a small numpy array with shape (2, 4) - batch size 2, feature dimension 4
X = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    "X": X
}
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 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
read_from_local Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/utils.py
code served (permissive licence) · get_code("67ca4f13b861a952")
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 pickle
import tempfile
import os

# Create a temporary directory and file
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_pickle.pkl")

# Create a simple object to pickle
test_obj = {"key": "value", "data": [1, 2, 3, 4, 5]}

# Write it to the temporary file
with open(temp_file, 'wb') as f:
    pickle.dump(test_obj, f)

ARGS = {
    "path": temp_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 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
sample_X_grid Ran
ran; our contract draft was wrong, not the code
weiyaw/tempered-posteriors/data.py
code served (permissive licence) · get_code("536d78b9441ea597")
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 ArrayImpl, 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 jax.numpy as jnp

# Analyze the function:
# - dim_x: used as dim_x[0], so it should be indexable (tuple, list, or array-like)
# - n_samples: used as argument to jnp.linspace, should be an integer

# dim_x is indexed with [0], so we make it a tuple/list
# The function creates X with shape (n_samples, dim_x[0])
dim_x = (4,)  # tuple with one element, will be indexed as dim_x[0]
n_samples = 2  # small integer for tiny tensors

ARGS = {
    "dim_x": dim_x,
    "n_samples": n_samples,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
calc_normal_logprob_resid Not yet run
unverified (harvested, no recorded run)
weiyaw/tempered-posteriors/metrics.py
code served (permissive licence) · get_code("b18d120529093966")
How it ran

no invocation recorded.

flatten_dict Not yet run
unverified (harvested, no recorded run)
weiyaw/tempered-posteriors/visual_utils.py
code served (permissive licence) · get_code("91345e63f4999e0e")
How it ran

no invocation recorded.

normal_like_tree Not yet run
unverified (harvested, no recorded run)
weiyaw/tempered-posteriors/sgmcmc.py
code served (permissive licence) · get_code("bace351d40c0081c")
How it ran

no invocation recorded.

sample_tree Not yet run
unverified (harvested, no recorded run)
weiyaw/tempered-posteriors/data.py
code served (permissive licence) · get_code("ee368fc45143d54a")
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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 12 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
add_classficiation 2 other papers
2 dated earlier
1806.05975 (2018-06)
Structured Variational Learning of Bayesian Neural Networks with Horseshoe Priors
2306.04201 (2023-06)
Improving Hyperparameter Learning under Approximate Inference in Gaussian Process Models
add_regression 2 other papers
2 dated earlier
1806.05975 (2018-06)
Structured Variational Learning of Bayesian Neural Networks with Horseshoe Priors
2306.04201 (2023-06)
Improving Hyperparameter Learning under Approximate Inference in Gaussian Process Models
normalize 2 other papers
2 dated earlier
1806.05975 (2018-06)
Structured Variational Learning of Bayesian Neural Networks with Horseshoe Priors
2306.04201 (2023-06)
Improving Hyperparameter Learning under Approximate Inference in Gaussian Process Models

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

The Cold Posterior Effect (CPE) is a phenomenon in Bayesian Deep Learning (BDL), where tempering the posterior to a cold temperature often improves the predictive performance of the posterior predictive distribution (PPD). Although the term `CPE' suggests colder temperatures are inherently better, the BDL community increasingly recognizes that this is not always the case. Despite this, there remains no systematic method for finding the optimal temperature beyond grid search. In this work, we propose a data-driven approach to select the temperature that maximizes test log-predictive density, treating the temperature as a model parameter and estimating it directly from the data. We empirically demonstrate that our method performs comparably to grid search, at a fraction of the cost, across both regression and classification tasks. Finally, we highlight the differing perspectives on CPE between the BDL and Generalized Bayes communities: while the former primarily emphasizes the predictive performance of the PPD, the latter prioritizes the utility of the posterior under model misspecification; these distinct objectives lead to different temperature preferences.

For agents

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

get_harvested_code_for_paper("2410.05757")
get_code_for_paper("2410.05757")
have("2410.05757")

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

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

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

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

Connect an agent — have() is free.