SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.07329 · ICML · 2020

Mix-n-Match: Ensemble and Compositional Methods for Uncertainty Calibration in Deep Learning

Jize Zhang, Bhavya Kailkhura, Yong-Jin Han

arXiv · PDF · Open in the Atlas

Code that ran

5 of 12 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, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 7 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/2003.07329.json · badge: /api/ran/2003.07329.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
zhang64-llnl/Mix-n-Match-Calibration canonical (classifier label)
classifier basis: classifier_2025
5 ran · 7 no recorded run
FunctionStatusWhere it lives
ece_hist_binary Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhang64-llnl/Mix-n-Match-Calibration/util_evaluation.py
code served (permissive licence) · get_code("c681afd6ee97fd0b")
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) and returned Tensor, ndim 1, dtype family float, shape (1,) 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)

# Create small test data for binary classification
N = 10  # number of samples
n_classes = 2

# Create probability predictions (N x n_classes)
p = np.random.dirichlet(np.ones(n_classes), N).astype(np.float32)

# Create one-hot encoded labels (N x n_classes)
label = np.zeros((N, n_classes))
for i in range(N):
    label[i, np.random.randint(0, n_classes)] = 1

ARGS = {
    "p": p,
    "label": label,
    "n_bins": 15,
    "order": 1
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 1, dtype family float, shape (1,) — shape (1,) 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
ensemble_scaling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("00b7e27c230bbc55")
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 (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 numpy as np

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

# Parameters for ensemble_scaling function
batch_size = 2
n_class = 4

# Create sample logits (batch_size x n_class)
logit = np.random.randn(batch_size, n_class).astype(np.float64)

# Create sample labels (batch_size x n_class) - one-hot or soft labels
label = np.zeros((batch_size, n_class))
label[0, 0] = 1.0
label[1, 2] = 1.0

# Temperature parameter
t = 1.5

# Loss type
loss = 'ce'

ARGS = {
    'logit': logit,
    'label': label,
    'loss': loss,
    't': t,
    'n_class': n_class
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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 (3,) — shape (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
ets_calibrate Ran
ran, honoured the contract we drafted
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("4f7d087cf3f23cd7")
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) and returned ndarray, 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 numpy as np
from scipy import optimize

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

# Create small synthetic data
batch_size = 2
n_class = 4

# Create logit arrays (batch_size x n_class)
# These are raw model outputs before softmax
logit = np.random.randn(batch_size, n_class).astype(np.float32)

# Create one-hot encoded labels (batch_size x n_class)
label = np.zeros((batch_size, n_class), dtype=np.float32)
label[0, 0] = 1.0
label[1, 2] = 1.0

# Create evaluation logits (different batch)
logit_eval = np.random.randn(batch_size, n_class).astype(np.float32)

# Define ARGS dictionary with all parameters for ets_calibrate
ARGS = {
    'logit': logit,
    'label': label,
    'logit_eval': logit_eval,
    'n_class': n_class,
    'loss': 'mse'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, 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
mirror_1d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhang64-llnl/Mix-n-Match-Calibration/util_evaluation.py
code served (permissive licence) · get_code("8f3819e94710b239")
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) and returned ndarray, ndim 2, dtype family float, shape (8, 1) 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

# Create a small 1D array for testing
d = np.array([[1.0], [2.0], [3.0], [4.0]])

# Define arguments for mirror_1d
ARGS = {
    "d": d,
    "xmin": 0.5,
    "xmax": 4.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family float, shape (8, 1) — shape (8, 1) 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
temperature_scaling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("a7c2ff72a09fddd9")
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 (1,) 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
from scipy import optimize

# Create small numpy arrays for logits and labels
# logit: (batch_size=2, num_classes=4) - raw model outputs
# label: (batch_size=2, num_classes=4) - one-hot encoded labels or probabilities
np.random.seed(0)
logit = np.random.randn(2, 4).astype(np.float32)
label = np.zeros((2, 4), dtype=np.float32)
label[0, 1] = 1.0  # First sample: class 1
label[1, 3] = 1.0  # Second sample: class 3

# Test with cross-entropy loss
loss = 'ce'

ARGS = {
    'logit': logit,
    'label': label,
    'loss': loss
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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 (1,) — shape (1,) 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
ll_t Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("be0ecdb9bbb14549")
How it ran

no invocation recorded.

ll_t Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("488e772a0fda66e3")
How it ran

no invocation recorded.

ll_w Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("f170643552b44a2c")
How it ran

no invocation recorded.

mse_t Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("965b11fe9a3ed9df")
How it ran

no invocation recorded.

mse_t Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("0e94d686cb427873")
How it ran

no invocation recorded.

mse_w Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("c7f9796a87c076ab")
How it ran

no invocation recorded.

mse_w Not yet run
unverified (harvested, no recorded run)
zhang64-llnl/Mix-n-Match-Calibration/util_calibration.py
code served (permissive licence) · get_code("2bdb47b16ce824b7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 8 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
mirror_1d 1 other paper
1 later
2203.08958 (2022-03)
On the Usefulness of the Fit-on-the-Test View on Evaluating Calibration of Classifiers

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

This paper studies the problem of post-hoc calibration of machine learning classifiers. We introduce the following desiderata for uncertainty calibration: (a) accuracy-preserving, (b) data-efficient, and (c) high expressive power. We show that none of the existing methods satisfy all three requirements, and demonstrate how Mix-n-Match calibration strategies (i.e., ensemble and composition) can help achieve remarkably better data-efficiency and expressive power while provably maintaining the classification accuracy of the original classifier. Mix-n-Match strategies are generic in the sense that they can be used to improve the performance of any off-the-shelf calibrator. We also reveal potential issues in standard evaluation practices. Popular approaches (e.g., histogram-based expected calibration error (ECE)) may provide misleading results especially in small-data regime. Therefore, we propose an alternative data-efficient kernel density-based estimator for a reliable evaluation of the calibration performance and prove its asymptotically unbiasedness and consistency. Our approaches outperform state-of-the-art solutions on both the calibration as well as the evaluation tasks in most of the experimental settings. Our codes are available at https://github.com/zhang64llnl/Mix-n-Match-Calibration.

For agents

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

get_harvested_code_for_paper("2003.07329")
get_code_for_paper("2003.07329")
have("2003.07329")

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

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

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

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

Connect an agent — have() is free.