SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2001.00106 · 2020

PAC Confidence Sets for Deep Neural Networks via Calibrated Prediction

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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 7 have no contract verdict; 0 failures of our instrument; 4 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/2001.00106.json · badge: /api/ran/2001.00106.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
sangdon/PAC-confidence-set canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
compute_conf_set_size Ran
ran on a synthesized input
sangdon/PAC-confidence-set/conf_set/utils.py
code served (permissive licence) · get_code("e58b508b43cabeb6")
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, 3) 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 as tc
import torch.nn as nn

tc.manual_seed(0)

# Create a small model that has a .size() method
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def size(self, xs, log_scale=False, time_summary=None):
        # xs is either a tensor or list of tensors
        if isinstance(xs, list):
            batch_size = xs[0].size(0)
        else:
            batch_size = xs.size(0)
        # Return a tensor of confidence set sizes (one per sample in batch)
        return tc.randn(batch_size, 3)

# Create a small data loader (list of (x, y) tuples)
ld = [
    (tc.randn(2, 4), tc.randint(0, 2, (2,))),
    (tc.randn(2, 4), tc.randint(0, 2, (2,))),
    (tc.randn(2, 4), tc.randint(0, 2, (2,))),
]

model = DummyModel()

ARGS = {
    'ld': ld,
    'model': model,
    'n': None,
    'log_scale': False,
    'time_summary': [-1],
    'device': tc.device('cpu'),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (6, 3) — shape (6, 3) 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
conf_set_summary_no_acc Ran
ran on a synthesized input
sangdon/PAC-confidence-set/demo/conf_set/pac_conf_set.py
code served (permissive licence) · get_code("60f581968fb3d4e4")
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 torch
import torch.nn as nn
import numpy as np
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

class SimpleForecaster(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class SimpleConfSet:
    def __init__(self, F, eps, delta, n, params=None):
        self.F = F
        self.eps = eps
        self.delta = delta
        self.n = n
        self.params = params

class ConfSetConstructor:
    def __init__(self, params, model_CS):
        self.params = params
        self.model_CS = model_CS
        self.device = torch.device('cpu')
    
    def train(self, train_data, val1_train_data, val1_data, val2_data):
        return True
    
    def test(self, test_datasets, dataset_names):
        return None, [np.array([0.5, 0.6, 0.7])]
    
    def conf_set_size(self, test_data, log_scale=False, time_summary=False):
        return torch.tensor([[0.1, 0.2, 0.3], [0.15, 0.25, 0.35]])

class DataLoader:
    def __init__(self, size=2):
        self.data = [(torch.randn(2, 4), torch.randint(0, 3, (2,))) for _ in range(size)]
    
    def __iter__(self):
        return iter(self.data)
    
    def __len__(self):
        return len(self.data)

forecaster = SimpleForecaster()

params = Mock()
params.exp_name = '/tmp/exp'
params.task = 'cls'

params.train = Mock()
params.train.exp_name = None

params.cal = Mock()
params.cal.exp_name = None

params.cs = Mock()
params.cs.n = [100]
params.cs.eps = [0.1]
params.cs.delta = [0.05]
params.cs.cond_thres = False
params.cs.no_acc = False
params.cs.no_cal = False
params.cs.no_db = False
params.cs.no_pac = False
params.cs.no_error = False

params.load_forecaster = Mock(return_value=forecaster)
params.ConfSet = SimpleConfSet
params.ConfSet_cond = SimpleConfSet

params.dataset = Mock()
params.dataset.ld = Mock()
params.dataset.ld.train = DataLoader(2)
params.dataset.ld.val1_train = DataLoader(2)
params.dataset.ld.val1 = DataLoader(2)
params.dataset.ld.val2 = DataLoader(2)
params.dataset.ld.test = DataLoader(2)

params.plot = Mock()
params.plot.time_summary = False
params.plot.ex_summary = 'none'

def mock_compute_print_cls_error(ld, name, model, device):
    pass

def mock_eval_print_ECE(ld_list, name_list, model1, model2):
    pass

import sys
module = sys.modules[__name__]
module.ConfSetConstructor = ConfSetConstructor
module.compute_print_cls_error = mock_compute_print_cls_error
module.eval_print_ECE = mock_eval_print_ECE

ARGS = {
    'params': params
}
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 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
empirical_cs_error Ran
ran on a synthesized input
sangdon/PAC-confidence-set/conf_set/utils.py
code served (permissive licence) · get_code("32c39e9392f53906")
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 as tc
import torch.nn as nn

tc.manual_seed(0)

# Build a minimal model that has a membership method
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def membership(self, xs, ys):
        # The function calls model.membership(xs, ys) and expects output
        # that can be compared with == 0 to produce a float tensor
        # Return a tensor of same length as ys with 0s and 1s
        if isinstance(xs, list):
            batch_size = xs[0].size(0)
        else:
            batch_size = xs.size(0)
        return tc.zeros(batch_size, dtype=tc.long)

model = MinimalModel()

# Build a minimal data loader - list of (xs, ys) tuples
# xs can be a tensor or list of tensors
# ys must be a tensor
ld = [
    (tc.randn(2, 4), tc.randint(0, 2, (2,))),
    (tc.randn(2, 4), tc.randint(0, 2, (2,))),
]

ARGS = {
    'model': model,
    'ld': ld,
    'n': None,
    'device': tc.device('cpu')
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
load_forecaster Ran
ran on a synthesized input
sangdon/PAC-confidence-set/demo/conf_set/imagenet/forecasters.py
code served (permissive licence) · get_code("76e184da8ee3ba11")
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 MagicMock. 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create mock Model classes since we can't import from models
class MockResNet152(nn.Module):
    def __init__(self, load_type=None):
        super().__init__()
        self.load_type = load_type
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

class MockTempForecaster(nn.Module):
    def __init__(self, model):
        super().__init__()
        self.model = model
    
    def forward(self, x):
        return self.model(x)

# Create a config object with the required structure
class ParamsConfig:
    def __init__(self):
        self.arch = Mock()
        self.arch.name = 'resnet152'
        self.dataset = Mock()
        self.dataset.load_type = 'default'

# Patch the imports so they return our mock classes
import sys
sys.modules['models'] = MagicMock()
sys.modules['models.ResNet'] = MagicMock()
sys.modules['models.CNN'] = MagicMock()
sys.modules['models.ScalarForecasters'] = MagicMock()

# Import the function
def load_forecaster(params):
    if params.arch.name is None or params.arch.name.lower() == 'resnet152':
        Model = MockResNet152
    elif params.arch.name.lower() == 'googlenet':
        Model = MockResNet152
    elif params.arch.name.lower() == 'alexnet':
        Model = MockResNet152
    elif params.arch.name.lower() == 'vgg19':
        Model = MockResNet152
    else:
        raise NotImplementedError
    CalForecaster = MockTempForecaster
    F = Model(load_type=params.dataset.load_type)
    F_cal = CalForecaster(F)
    return F_cal

params = ParamsConfig()

ARGS = {
    'params': params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
models, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MagicMock — a MagicMock output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MagicMock output the recorded ndim 1 and dtype family None 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
params2exp_name Ran
ran on a synthesized input
sangdon/PAC-confidence-set/conf_set/utils.py
code served (permissive licence) · get_code("b310183d59e46d2e")
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
import torch.nn as nn


class CSParams:
    def __init__(self):
        self.no_acc = False
        self.no_cal = False
        self.no_db = False
        self.T = None
        self.no_error = False
        self.cond_thres = False


class Params:
    def __init__(self):
        self.cs = CSParams()


ARGS = {
    'params': Params()
}
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
sample_exp_two_sides Ran
ran on a synthesized input
sangdon/PAC-confidence-set/demo/conf_set/otb/boundingbox.py
code served (permissive licence) · get_code("b4236802f7672016")
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 random
import math

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

# Define ARGS dictionary with all parameters for sample_exp_two_sides
ARGS = {
    'lambda_': 0.5
}
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 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
to_tree_namespace Ran
ran on a synthesized input
sangdon/PAC-confidence-set/demo/conf_set/opts/options.py
code served (permissive licence) · get_code("9ffed0e6ca58379d")
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 Namespace. 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 argparse

torch_seed = 0

params = argparse.Namespace()

# Add some flat keys (no dots)
params.learning_rate = 0.001
params.batch_size = 32
params.model_name = "test_model"

# Add some dotted keys that should be converted to nested namespaces
setattr(params, "optimizer.type", "adam")
setattr(params, "optimizer.momentum", 0.9)
setattr(params, "scheduler.name", "cosine")
setattr(params, "scheduler.warmup_steps", 100)

ARGS = {
    "params": params
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
compute_conf_set_size_plot Not yet run
unverified (harvested, no recorded run)
sangdon/PAC-confidence-set/demo/conf_set/pac_conf_set.py
code served (permissive licence) · get_code("2823f2f77b4e93a5")
How it ran

no invocation recorded.

compute_tracking_error Not yet run
unverified (harvested, no recorded run)
sangdon/PAC-confidence-set/demo/conf_set/otb/calibrator.py
code served (permissive licence) · get_code("7aa65a94b2735f8e")
How it ran

no invocation recorded.

dist_mah Not yet run
unverified (harvested, no recorded run)
sangdon/PAC-confidence-set/demo/conf_set/halfcheetah/forecasters.py
code served (permissive licence) · get_code("dd47487b498ea506")
How it ran

no invocation recorded.

train_test Not yet run
unverified (harvested, no recorded run)
sangdon/PAC-confidence-set/demo/conf_set/pac_conf_set.py
code served (permissive licence) · get_code("797caafd880d3d90")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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.

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

We propose an algorithm combining calibrated prediction and generalization bounds from learning theory to construct confidence sets for deep neural networks with PAC guarantees---i.e., the confidence set for a given input contains the true label with high probability. We demonstrate how our approach can be used to construct PAC confidence sets on ResNet for ImageNet, a visual object tracking model, and a dynamics model for the half-cheetah reinforcement learning problem.

For agents

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

get_harvested_code_for_paper("2001.00106")
get_code_for_paper("2001.00106")
have("2001.00106")

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

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

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

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

Connect an agent — have() is free.