SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.09192 · ICLR · 2022

Learning Optimal Conformal Classifiers

Arnaud Doucet, David Stutz, Dvijotham, Krishnamurthy, Ali Taylan Cemgil

arXiv · PDF · Open in the Atlas

Code that ran

18 of 24 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 15 have no contract verdict; 1 failure of our instrument; 6 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/2110.09192.json · badge: /api/ran/2110.09192.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
deepmind/conformal_training canonical (classifier label)
classifier basis not recorded on the link
17 ran · 4 no recorded run
nvlabs/pac-bayes-conformal-prediction community
Papers with Code archive
1 ran · 2 no recorded run
FunctionStatusWhere it lives
augment_flip_crop Ran
ran on a synthesized input
deepmind/conformal_training/data.py
code served (permissive licence) · get_code("81003c641202bd0f")
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 tensorflow as tf

# Create a small image tensor (batch_size=2, height=4, width=4, channels=3)
# Standard CIFAR10-like image with values in [0, 255] range
image = tf.constant([
    [[[100, 150, 200], [110, 160, 210], [120, 170, 220], [130, 180, 230]],
     [[105, 155, 205], [115, 165, 215], [125, 175, 225], [135, 185, 235]],
     [[108, 158, 208], [118, 168, 218], [128, 178, 228], [138, 188, 238]],
     [[112, 162, 212], [122, 172, 222], [132, 182, 232], [142, 192, 242]]],
    [[[50, 100, 150], [60, 110, 160], [70, 120, 170], [80, 130, 180]],
     [[55, 105, 155], [65, 115, 165], [75, 125, 175], [85, 135, 185]],
     [[58, 108, 158], [68, 118, 168], [78, 128, 178], [88, 138, 188]],
     [[62, 112, 162], [72, 122, 172], [82, 132, 182], [92, 142, 192]]]
], dtype=tf.uint8)

# Create a batch dictionary with image and label
batch = {
    'image': image[0],  # Single image from batch: shape (4, 4, 3)
    'label': tf.constant(3, dtype=tf.int32)
}

# Define parameters for the function
shape = (6, 6, 3)  # Target shape after padding and cropping: height=6, width=6, channels=3
crop = 1  # Maximum cropping on each side
mode = 'CONSTANT'  # Padding mode for tf.pad
replace = 128  # Value to use for constant padding

ARGS = {
    'batch': batch,
    'shape': shape,
    'crop': crop,
    'mode': mode,
    'replace': replace
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — 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
avg_loss_constraint Ran
ran, honoured the contract we drafted
nvlabs/pac-bayes-conformal-prediction/src/confpred/optim.py
pointer only (licence: NOASSERTION) · get_code("2dc41514d7c8bde7")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/pac-bayes-conformal-prediction (NOASSERTION). 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.

backward_step Ran
ran on a synthesized input
deepmind/conformal_training/variational_sorting_net.py
code served (permissive licence) · get_code("9cad00fe020fc4a7")
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 (4, 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 jax.numpy as jnp
import numpy as np

# Define the ARGS dictionary with valid arguments for backward_step

# Create a small communication structure with edge list
# For a sorting network stage, we need pairs of indices to butterfly
comms = {
    'edge_list': [
        # Stage 0: pairs of indices to communicate
        jnp.array([[0, 1], [2, 3]])
    ]
}

# Create input u - can be 1D or 2D
# Using 2D case: shape (4, 3) for 4 elements with 3 features each
u = jnp.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
])

# stage_idx selects which stage of the sorting network to execute
stage_idx = 0

# lam is the interpolation parameter, shape (2,) for 2 butterfly operations in this stage
lam = jnp.array([0.3, 0.7])

ARGS = {
    'u': u,
    'stage_idx': stage_idx,
    'comms': comms,
    'lam': lam
}
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 ArrayImpl, ndim 2, dtype family float, shape (4, 3) — shape (4, 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
blend Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
deepmind/conformal_training/auto_augment.py
code served (permissive licence) · get_code("985152c5e3f36838")
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 SymbolicTensor. 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 tensorflow.compat.v2 as tf
import numpy as np

# Create two small uint8 image tensors
image1_np = np.array([[[100, 150, 200], [50, 75, 100]],
                       [[120, 160, 180], [60, 80, 120]]], dtype=np.uint8)
image1 = tf.constant(image1_np, dtype=tf.uint8)

image2_np = np.array([[[200, 200, 200], [100, 100, 100]],
                       [[180, 180, 180], [120, 120, 120]]], dtype=np.uint8)
image2 = tf.constant(image2_np, dtype=tf.uint8)

factor = 0.5

ARGS = {
    "image1": image1,
    "image2": image2,
    "factor": factor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
butterfly Ran
ran on a synthesized input
deepmind/conformal_training/variational_sorting_net.py
code served (permissive licence) · get_code("7f91d2d665604222")
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 3, 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 numpy as np

torch.manual_seed(0)

# The butterfly function takes:
# - lam: a scalar (likely a float or tensor scalar)
# - x1: a tensor or array-like object
# - x2: a tensor or array-like object
# The function performs linear interpolation between x1 and x2

lam = 0.3
x1 = torch.randn(2, 4)
x2 = torch.randn(2, 4)

ARGS = {
    "lam": lam,
    "x1": x1,
    "x2": x2,
}
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 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
calibrate_threshold Ran
ran on a synthesized input
deepmind/conformal_training/conformal_prediction.py
code served (permissive licence) · get_code("e807c30774b5a051")
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.numpy as jnp
import numpy as np

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

# Create small test data
batch_size = 2
num_classes = 4

# probabilities: shape (batch_size, num_classes)
# Contains predicted probabilities for each class
probabilities = jnp.array([
    [0.1, 0.6, 0.2, 0.1],
    [0.3, 0.2, 0.4, 0.1]
], dtype=jnp.float32)

# labels: shape (batch_size,)
# Ground truth class indices
labels = jnp.array([1, 2], dtype=jnp.int32)

# alpha: confidence level
alpha = 0.1

# quantile_fn: function to compute conformal quantile
# Using the provided conformal_quantile function
def conformal_quantile(array, q):
    return jnp.quantile(array, (1 + 1.0 / array.shape[0]) * q, method='midpoint')

quantile_fn = conformal_quantile

ARGS = {
    "probabilities": probabilities,
    "labels": labels,
    "alpha": alpha,
    "quantile_fn": quantile_fn
}
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 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
comm_pattern_bitonic Ran
ran on a synthesized input
deepmind/conformal_training/sorting_nets.py
code served (permissive licence) · get_code("0bc4c884c3aac9a3")
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 numpy as np

def comm_pattern_bitonic(num_bits):
    """Bitonic sort communication pattern on a hypercube of size 2**num_bits.

  Args:
    num_bits: size of the array to be sorted is 2**num_bits
  Returns:
    comms: Catalog
  """
    jnp = np
    total_stages = num_bits * (num_bits + 1) // 2
    edge_list = []
    absolute_substage = 0
    for stage in range(num_bits):
        for substage in range(stage + 1):
            i = np.arange(2 ** (num_bits - stage + substage - 1))
            j = np.arange(2 ** (stage - substage))
            idx1 = jnp.reshape(i.reshape((i.shape[0], 1)) * 2 ** (stage - substage + 1) + j.reshape((1, j.shape[0])), i.shape[0] * j.shape[0])
            idx2 = idx1 + 2 ** (stage - substage)
            direction = idx1 // 2 ** (stage + 1) % 2
            edges = np.zeros([2 ** (num_bits - 1), 2], dtype=np.int32)
            edges[:, 0] = np.where(direction == 0, idx1, idx2)
            edges[:, 1] = np.where(direction == 0, idx2, idx1)
            edge_list.append(jnp.array(edges))
            absolute_substage += 1
    return {'alg': 'bitonic', 'num_wires': 2 ** num_bits, 'num_stages': total_stages, 'num_comparators': total_stages * 2 ** (num_bits - 1), 'edge_list': edge_list}

ARGS = {
    'num_bits': 2
}
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 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
comm_pattern_from_list Ran
ran on a synthesized input
deepmind/conformal_training/sorting_nets.py
code served (permissive licence) · get_code("3ac1a2c338105bb8")
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 numpy as np

# Create a simple sorting network represented as a list of stages
# Each stage is a list of edges (comparators), where each edge is a pair [i, j]
# representing a comparison between positions i and j

# Example: a 4-element sorting network with multiple stages
snet_list = [
    [[0, 1], [2, 3]],           # Stage 1: compare (0,1) and (2,3) in parallel
    [[1, 2]],                    # Stage 2: compare (1,2)
    [[0, 1]],                    # Stage 3: compare (0,1)
]

ARGS = {
    'snet_list': snet_list,
    'make_parallel': False,
}
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 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
compute_accuracy Ran
ran on a synthesized input
deepmind/conformal_training/evaluation.py
code served (permissive licence) · get_code("2504d3a1635ed126")
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.numpy as jnp
import numpy as np

# Create small test data
batch_size = 2
num_classes = 4

# Create random probabilities (softmax output, should sum to 1 per sample)
probabilities_data = np.array([
    [0.7, 0.1, 0.1, 0.1],
    [0.1, 0.8, 0.05, 0.05]
], dtype=np.float32)
probabilities = jnp.array(probabilities_data)

# Create ground truth labels (class indices from 0 to num_classes-1)
labels = jnp.array([0, 1], dtype=jnp.int32)

ARGS = {
    "probabilities": probabilities,
    "labels": labels,
}
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 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
compute_conditional_accuracy_with_checks Ran
ran on a synthesized input
deepmind/conformal_training/evaluation.py
code served (permissive licence) · get_code("dc44afe5b06af967")
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.numpy as jnp

# Set up small valid test data
n_examples = 2
n_classes = 4

# Create probabilities: shape (n_examples, n_classes)
# Using softmax-like values (normalized probabilities)
probabilities = jnp.array([
    [0.7, 0.1, 0.1, 0.1],
    [0.2, 0.3, 0.4, 0.1]
])

# Create ground truth labels: shape (n_examples,)
# Labels must be integers in range [0, n_classes)
labels = jnp.array([0, 2], dtype=jnp.int32)

# Create conditional labels: shape (n_examples,)
# These are also integer labels to condition on
conditional_labels = jnp.array([1, 1], dtype=jnp.int32)

# Select a conditional label value to compute accuracy on
conditional_label = 1

ARGS = {
    "probabilities": probabilities,
    "labels": labels,
    "conditional_labels": conditional_labels,
    "conditional_label": conditional_label
}
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 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
conformal_quantile_with_checks Ran
ran on a synthesized input
deepmind/conformal_training/conformal_prediction.py
code served (permissive licence) · get_code("3ce3ac6b8e6636f3")
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.numpy as jnp

# Create a valid 1D array of non-empty values
array = jnp.array([1.0, 2.0, 3.0, 4.0, 5.0])

# Create a valid quantile value in [0, 1]
q = 0.5

ARGS = {
    "array": array,
    "q": q,
}
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 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_cnn Ran
ran on a synthesized input
deepmind/conformal_training/models.py
code served (permissive licence) · get_code("ef07ae80f9440fde")
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 TransformedWithState. 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
from jax import numpy as jnp
import numpy as np

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

# Create small whitening tuple (means and stds for 3 channels)
whitening_means = jnp.array(np.random.randn(3).astype(np.float32))
whitening_stds = jnp.array(np.abs(np.random.randn(3)).astype(np.float32) + 0.1)
whitening = (whitening_means, whitening_stds)

ARGS = {
    'classes': 10,
    'activation': 'relu',
    'channels': [32, 64, 128],
    'kernels': [3, 3, 3],
    'whitening': whitening,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
haiku, jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformedWithState — a TransformedWithState output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TransformedWithState output the recorded ndim 1 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
create_mlp Ran
ran on a synthesized input
deepmind/conformal_training/models.py
code served (permissive licence) · get_code("78e646ce84523a39")
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 TransformedWithState. 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
from jax import numpy as jnp
import haiku as hk

# Set random seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Create whitening tuple with mean and std arrays
# Shape: (1, 1, 1, channels) - will be reshaped in _apply_whitening
whitening_mean = jnp.ones((1, 1, 1, 3)) * 0.5
whitening_std = jnp.ones((1, 1, 1, 3)) * 0.2

ARGS = {
    'classes': 10,
    'activation': 'relu',
    'units': [64, 32],
    'whitening': (whitening_mean, whitening_std)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
haiku, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformedWithState — a TransformedWithState output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TransformedWithState output the recorded ndim 1 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
forward_step Ran
ran on a synthesized input
deepmind/conformal_training/variational_sorting_net.py
code served (permissive licence) · get_code("66379d1592d6ff49")
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 jax
import jax.numpy as jnp
import numpy as np

# Create a small sorting network communication structure
# The edge_list contains pairs of indices that should be compared/swapped at each stage
edge_list = [
    jnp.array([[0, 1], [2, 3]], dtype=jnp.int32),  # stage 0: compare (0,1) and (2,3)
    jnp.array([[0, 2], [1, 3]], dtype=jnp.int32),  # stage 1: compare (0,2) and (1,3)
    jnp.array([[1, 2]], dtype=jnp.int32),           # stage 2: compare (1,2)
]

comms = {
    'edge_list': edge_list
}

# Create input values to sort
x = jnp.array([3.5, 1.2, 2.8, 0.9], dtype=jnp.float32)

# Create a random key for JAX
key = jax.random.PRNGKey(0)

ARGS = {
    'x': x,
    'stage_idx': 0,
    'comms': comms,
    'dispersion': 1.0,
    'swap_prob_fun': lambda x1, x2, disp: jnp.exp(2 * jax.nn.relu(x2 - x1) / disp - jnp.logaddexp(2 * jax.nn.relu(x2 - x1) / disp, 2 * jax.nn.relu(x1 - x2) / disp)),
    'hard_swap_prob_fun': lambda x1, x2: jnp.array(jnp.greater(x1, x2), dtype=jnp.float32),
    'key': None
}
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 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_groups Ran
ran on a synthesized input
deepmind/conformal_training/colab_utils.py
code served (permissive licence) · get_code("678c8c5bb71dae99")
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 1, dtype family int, shape (10,) 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

ARGS = {
    "dataset": "mnist",
    "key": "identity"
}
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 1, dtype family int, shape (10,) — shape (10,) 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
prune Ran
ran on a synthesized input
deepmind/conformal_training/sorting_nets.py
code served (permissive licence) · get_code("f0772d96f45ed98e")
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. 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)

# Analyzing the function:
# - snet_list: a list of stages, where each stage is a list of edges
# - Each edge appears to be a tuple/list with at least 2 elements (edge[0], edge[1])
# - keep: an iterable of wire identifiers (converted to set)
# - The function traverses snet_list in reverse, checking if edge endpoints are in keep
# - It builds a pruned_list with the same structure

# Construct valid arguments:
# snet_list should be a list of lists of edges (tuples with 2 elements each)
# keep should be an iterable of wire identifiers

snet_list = [
    # Stage 0 (will be processed last due to reversed())
    [
        (1, 2),
        (3, 4),
        (5, 6),
    ],
    # Stage 1
    [
        (0, 1),
        (2, 3),
    ],
    # Stage 2 (will be processed first due to reversed())
    [
        (0, 5),
        (7, 8),
    ],
]

keep = [0, 1]

ARGS = {
    "snet_list": snet_list,
    "keep": keep,
}
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 list — a list 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
smooth_predict_threshold Ran
ran on a synthesized input
deepmind/conformal_training/smooth_conformal_prediction.py
code served (permissive licence) · get_code("d0417a540db4e413")
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
import jax.numpy as jnp
import numpy as np

# Create small test data
probabilities = jnp.array([[0.1, 0.5, 0.8, 0.3],
                           [0.2, 0.9, 0.4, 0.6]], dtype=jnp.float32)

tau = 0.5
temperature = 0.1

ARGS = {
    "probabilities": probabilities,
    "tau": tau,
    "temperature": temperature
}
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 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
solarize Ran
ran, violated the contract we drafted
deepmind/conformal_training/auto_augment.py
code served (permissive licence) · get_code("f483cc864d3d3300")
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 SymbolicTensor. 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 tensorflow.compat.v2 as tf
import numpy as np

# Create a small test image as a TensorFlow tensor
# Using uint8 type typical for images with values 0-255
image = tf.constant(np.random.randint(0, 256, size=(2, 4, 3), dtype=np.uint8), dtype=tf.uint8)

# Convert to float for the solarize operation (which uses arithmetic)
image = tf.cast(image, tf.float32)

ARGS = {
    "image": image,
    "threshold": 128
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
aug_lag_constrained_opt Not yet run
unverified (harvested, no recorded run)
nvlabs/pac-bayes-conformal-prediction/src/confpred/optim.py
pointer only (licence: NOASSERTION) · get_code("feaee25fb32d4501")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/pac-bayes-conformal-prediction (NOASSERTION). 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.

compute_conditional_accuracy Not yet run
unverified (harvested, no recorded run)
deepmind/conformal_training/evaluation.py
code served (permissive licence) · get_code("42ff9c6b22dfac9f")
How it ran

no invocation recorded.

conformal_quantile Not yet run
unverified (harvested, no recorded run)
deepmind/conformal_training/conformal_prediction.py
code served (permissive licence) · get_code("644a7a98b9d52da2")
How it ran

no invocation recorded.

create_resnet Not yet run
unverified (harvested, no recorded run)
deepmind/conformal_training/models.py
code served (permissive licence) · get_code("beb3dd8196db1da5")
How it ran

no invocation recorded.

cutout Not yet run
unverified (harvested, no recorded run)
deepmind/conformal_training/auto_augment.py
code served (permissive licence) · get_code("4515269703640fc7")
How it ran

no invocation recorded.

unconstrained_opt Not yet run
unverified (harvested, no recorded run)
nvlabs/pac-bayes-conformal-prediction/src/confpred/optim.py
pointer only (licence: NOASSERTION) · get_code("287d6c7e0ca58d08")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, nvlabs/pac-bayes-conformal-prediction (NOASSERTION). 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.

Also present in other papers' code

Of 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 22 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
solarize 4 other papers
3 dated earlier, 1 later
1911.04252 (2019-11)
Self-training with Noisy Student improves ImageNet classification
2006.14536 (2020-06)
Smooth Adversarial Training
2103.16201 (2021-03)
MT3: Meta Test-Time Training for Self-Supervised Test-Time Adaption
and 1 more not named here
blend 1 other paper
1 dated earlier
2103.16201 (2021-03)
MT3: Meta Test-Time Training for Self-Supervised Test-Time Adaption

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

Modern deep learning based classifiers show very high accuracy on test data but this does not provide sufficient guarantees for safe deployment, especially in highstake AI applications such as medical diagnosis. Usually, predictions are obtained without a reliable uncertainty estimate or a formal guarantee. Conformal prediction (CP) addresses these issues by using the classifier's predictions, e.g., its probability estimates, to predict confidence sets containing the true class with a user-specified probability. However, using CP as a separate processing step after training prevents the underlying model from adapting to the prediction of confidence sets. Thus, this paper explores strategies to differentiate through CP during training with the goal of training model with the conformal wrapper end-to-end. In our approach, conformal training (ConfTr), we specifically "simulate" conformalization on mini-batches during training. Compared to standard training, ConfTr reduces the average confidence set size (inefficiency) of state-of-the-art CP methods applied after training. Moreover, it allows to "shape" the confidence sets predicted at test time, which is difficult for standard CP. On experiments with several datasets, we show ConfTr can influence how inefficiency is distributed across classes, or guide the composition of confidence sets in terms of the included classes, while retaining the guarantees offered by CP.

For agents

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

get_harvested_code_for_paper("2110.09192")
get_code_for_paper("2110.09192")
have("2110.09192")

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

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

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

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

Connect an agent — have() is free.