SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.06818 · 2024

Conformal Prediction for Class-wise Coverage via Augmented Label Rank Calibration

arXiv · PDF · Open in the Atlas

Code that ran

21 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, 0 violated it and 0 have no contract verdict; 20 failures of our instrument; 3 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/2406.06818.json · badge: /api/ran/2406.06818.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
yuanjiesh/rc3p canonical (classifier label)
classifier basis: census
21 ran · 3 no recorded run
FunctionStatusWhere it lives
Extract Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/utils_others.py
code served (permissive licence) · get_code("a13fb468b655e0b0")
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 torch
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory for RootPath
temp_dir = tempfile.mkdtemp()

# Create a stand-in args class with required attributes
class Args:
    def __init__(self, root_path):
        self.RootPath = root_path

args_obj = Args(root_path=temp_dir)

# Create a minimal data loader: list of (x, target) tuples
# x is a tensor, target is a tensor with labels
# Mix of label 9 (anomaly) and other labels
train_loader = [
    (torch.randn(2, 4), torch.tensor(5)),      # batch of 2, dim 4, label 5 (normal)
    (torch.randn(2, 4), torch.tensor(9)),      # batch of 2, dim 4, label 9 (anomaly)
    (torch.randn(2, 4), torch.tensor(3)),      # batch of 2, dim 4, label 3 (normal)
    (torch.randn(2, 4), torch.tensor(9)),      # batch of 2, dim 4, label 9 (anomaly)
]

ARGS = {
    'args': args_obj,
    'train_loader': train_loader,
    'SubFol': '/Train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
accuracy_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuanjiesh/rc3p/ICP/generate_score.py
code served (permissive licence) · get_code("165c9590c92e284d")
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 2, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from collections import defaultdict

torch.manual_seed(0)

# Build a minimal model
class SimpleModel(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Build a minimal data loader (list of batches)
def create_val_loader(num_batches=2, batch_size=2, input_dim=4, num_classes=3):
    loader = []
    for _ in range(num_batches):
        inputs = torch.randn(batch_size, input_dim)
        targets = torch.randint(0, num_classes, (batch_size,))
        loader.append((inputs, targets))
    return loader

# Build args object
class Args:
    def __init__(self, gpu=None):
        self.gpu = gpu

# Create instances
model = SimpleModel(num_classes=3)
val_loader = create_val_loader(num_batches=2, batch_size=2, input_dim=4, num_classes=3)
args = Args(gpu=None)
num_class = 3

ARGS = {
    'val_loader': val_loader,
    'model': model,
    'args': args,
    'num_class': num_class
}
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 2, 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
average_results_across_seeds Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/main_aps.py
code served (permissive licence) · get_code("bf0624cf01d64c5b")
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 DataFrame. 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
import os
import pickle
import tempfile
import shutil

# Create a temporary directory for test pickle files
temp_dir = tempfile.mkdtemp()

# Create sample pickle files with the expected structure
sample_results = {
    'MCP': {
        2: {
            'undercov ratio': 0.05,
            'average set size': 2.3
        }
    },
    'CCP': {
        2: {
            'undercov ratio': 0.08,
            'average set size': 2.1
        }
    },
    'k-CCP': {
        2: {
            'undercov ratio': 0.06,
            'average set size': 2.4
        }
    }
}

# Write multiple pickle files (representing different seeds)
for seed_idx in range(3):
    file_path = os.path.join(temp_dir, f'results_seed_{seed_idx}.pkl')
    with open(file_path, 'wb') as f:
        pickle.dump(sample_results, f)

# Define ARGS
ARGS = {
    'folder': temp_dir,
    'print_results': True,
    'show_seed_ct': True,
    'methods': ['MCP', 'CCP', 'k-CCP'],
    'max_seeds': np.inf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
calc_top_k_accuracy_per_class Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuanjiesh/rc3p/ICP/generate_score.py
code served (permissive licence) · get_code("5e94402af51c3024")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.utils.data import DataLoader
import numpy as np

torch.manual_seed(0)

# Define a minimal model that takes input and produces output
class SimpleClassifier(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Create a minimal data loader (list of batches)
def create_val_loader():
    batch_size = 2
    num_batches = 2
    num_classes = 3
    input_dim = 4
    
    batches = []
    for _ in range(num_batches):
        # Create random input and target
        input_tensor = torch.randn(batch_size, input_dim)
        target_tensor = torch.randint(0, num_classes, (batch_size,))
        batches.append((input_tensor, target_tensor))
    
    return batches

# Create a simple args object
class Args:
    def __init__(self):
        self.gpu = None  # CPU only

# Construct the ARGS dictionary
model = SimpleClassifier(num_classes=3)
val_loader = create_val_loader()
args = Args()
k = 2

ARGS = {
    "val_loader": val_loader,
    "model": model,
    "args": args,
    "k": k
}
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 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
embed_all_classes Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuanjiesh/rc3p/ICP/clustering_utils.py
code served (permissive licence) · get_code("8de2541ba434c627")
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 2, dtype family float, shape (3, 5) 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)

# Create small test data
num_instances = 8
num_classes = 3

# Case 1: 2D scores array (num_instances x num_classes)
scores_all_2d = np.random.rand(num_instances, num_classes)

# Labels for instances - ensure all classes are represented
labels = np.array([0, 0, 1, 1, 2, 2, 0, 1])

# Quantiles to use
q = [0.5, 0.6, 0.7, 0.8, 0.9]

# Define ARGS with all parameters
ARGS = {
    "scores_all": scores_all_2d,
    "labels": labels,
    "q": q,
    "return_cts": 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 ndarray, ndim 2, dtype family float, shape (3, 5) — shape (3, 5) 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
focal_loss Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/train/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from tmlr-group/atol, is pointer only (licence: NONE) · get_code("4dcf06ba28983266")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from tmlr-group/atol, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

generate_synthetic_clustered_data Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/clustering_utils.py
code served (permissive licence) · get_code("ec757d7558e850db")
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

np.random.seed(0)

ARGS = {
    "num_clusters": 3,
    "num_classes": 5,
    "num_samples_per_class": 10,
    "cluster_probs": np.array([0.3, 0.5, 0.2]),
    "dist_between_means": 1000,
    "sd": 1
}
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
get_quantile_threshold Ran
ran, honoured the contract we drafted
yuanjiesh/rc3p/ICP/conformal_utils2.py
code served (permissive licence) · get_code("684de5d3a8583399")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

def get_quantile_threshold(alpha):
    """
    Compute smallest n such that ceil((n+1)*(1-alpha)/n) <= 1
    """
    n = 1
    while np.ceil((n + 1) * (1 - alpha) / n) > 1:
        n += 1
    return n

ARGS = {
    "alpha": 0.05
}
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 int, ndim 0, dtype family int, 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
get_softmax_and_ranks Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuanjiesh/rc3p/ICP/generate_score.py
code served (permissive licence) · get_code("e156cd71262c686a")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np

torch.manual_seed(0)

# Create a minimal model that matches what the function expects
class MinimalModel(nn.Module):
    def __init__(self, num_classes=4):
        super().__init__()
        self.linear = nn.Linear(3, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal data loader (list of batches)
def create_val_loader(batch_size=2, num_batches=2, input_dim=3, num_classes=4):
    loader = []
    for _ in range(num_batches):
        x = torch.randn(batch_size, input_dim)
        targets = torch.randint(0, num_classes, (batch_size,))
        loader.append((x, targets))
    return loader

# Create args with necessary attributes
class Args:
    def __init__(self):
        self.gpu = 'cpu'

ARGS = {
    'val_loader': create_val_loader(batch_size=2, num_batches=2, input_dim=3, num_classes=4),
    'model': MinimalModel(num_classes=4),
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
initialize_dict Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/main_aps.py
code served (permissive licence) · get_code("652a22184abebb5b")
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 torch
import numpy as np

torch.manual_seed(0)

metrics = ['accuracy', 'loss', 'f1']
methods = ['baseline', 'proposed', 'ensemble']
suffixes = ['mean', 'std']

ARGS = {
    'metrics': metrics,
    'methods': methods,
    'suffixes': suffixes
}
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 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
initialize_metrics_dict Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/main_aps.py
code served (permissive licence) · get_code("0d90c4b9c588c0bd")
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 torch

torch.manual_seed(0)

methods = ['method_a', 'method_b', 'method_c']

ARGS = {
    'methods': methods
}
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 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
quantile_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuanjiesh/rc3p/ICP/clustering_utils.py
code served (permissive licence) · get_code("0d4621927b1a4c0f")
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 (5,) 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 sample data - a simple array of numerical values
samples = np.random.randn(100)

# Define quantiles to compute
q = [0.5, 0.6, 0.7, 0.8, 0.9]

# Construct the arguments dictionary
ARGS = {
    'samples': samples,
    'q': q
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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
random_split Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/conformal_utils2.py
code served (permissive licence) · get_code("d3fbca0bd0a89dc5")
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 dataset with multiple classes
np.random.seed(0)

# X: 10 samples with 4 features each
X = np.random.randn(10, 4)

# y: class labels (0-indexed), with 3 classes
y = np.array([0, 0, 0, 1, 1, 1, 2, 2, 2, 2])

# avg_num_per_class: 2 examples per class on average
avg_num_per_class = 2

# seed: for reproducibility
seed = 0

ARGS = {
    "X": X,
    "y": y,
    "avg_num_per_class": avg_num_per_class,
    "seed": seed,
}
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
resnet18 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_eurosat.py
code served (permissive licence) · get_code("f2b5240bcfd4cf3a")
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 ResNet18. 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)

ARGS = {
    "num_classes": 200,
    "use_norm": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNet18 — a ResNet18 output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet18 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
resnet18 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_tiny.py
code served (permissive licence) · get_code("607bb2c5904df9e5")
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 ResNet18. 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
import torch.nn.functional as F
import torch.nn.init as init
from torch.nn import Parameter
import torchvision

torch.manual_seed(0)

def _weights_init(m):
    classname = m.__class__.__name__
    if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d):
        init.kaiming_normal_(m.weight)

class NormedLinear(nn.Module):

    def __init__(self, in_features, out_features):
        super(NormedLinear, self).__init__()
        self.weight = Parameter(torch.Tensor(in_features, out_features))
        self.weight.data.uniform_(-1, 1).renorm_(2, 1, 1e-05).mul_(100000.0)

    def forward(self, x):
        out = F.normalize(x, dim=1).mm(F.normalize(self.weight, dim=0))
        return out

class ResNet18(nn.Module):

    def __init__(self, num_classes=200, use_norm=False):
        super(ResNet18, self).__init__()
        self.model = torchvision.models.resnet18(pretrained=False)
        if use_norm:
            linear = NormedLinear(512, num_classes)
        else:
            linear = nn.Linear(512, num_classes)
        self.model.fc = linear
        self.model.apply(_weights_init)

    def forward(self, x):
        out = self.model(x)
        return out

def resnet18(num_classes=200, use_norm=False):
    return ResNet18(num_classes=num_classes, use_norm=use_norm)

ARGS = {
    "num_classes": 10,
    "use_norm": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNet18 — a ResNet18 output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet18 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
resnet20 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_cifar.py
code served (permissive licence) · get_code("682ea0b23a9b9564")
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 ResNet_s. 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)

ARGS = {
    "num_classes": 10,
    "use_norm": False,
    "features": 3,
}
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 ResNet_s — a ResNet_s output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_s 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
resnet20 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_eurosat.py
code served (permissive licence) · get_code("f332591908476ccc")
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 ResNet_s. 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)

ARGS = {
    "num_classes": 10,
    "use_norm": False,
    "features": 3,
}
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 ResNet_s — a ResNet_s output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_s 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
resnet32 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_cifar.py
code served (permissive licence) · get_code("c855e300f1337b9f")
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 ResNet_s. 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)

ARGS = {
    "num_classes": 10,
    "use_norm": False,
    "features": 3,
}
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 ResNet_s — a ResNet_s output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_s 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
resnet32 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_eurosat.py
code served (permissive licence) · get_code("11d038f53d77a8d2")
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 ResNet_s. 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)

ARGS = {
    'num_classes': 10,
    'use_norm': False,
}
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 ResNet_s — a ResNet_s output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_s 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
resnet44 Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/models/resnet_cifar.py
code served (permissive licence) · get_code("06958241b55ab4aa")
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 ResNet_s. 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)

ARGS = {
    'num_classes': 10,
    'use_norm': False,
    'features': 3,
}
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 ResNet_s — a ResNet_s output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_s 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
split_X_and_y_Orin Ran
ran; our contract draft was wrong, not the code
yuanjiesh/rc3p/ICP/conformal_utils2.py
code served (permissive licence) · get_code("3293a3745a74653c")
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

np.random.seed(0)

# Create a small dataset with 3 classes
# X: 12 samples, 4 features each
X = np.random.randn(12, 4).astype(np.float32)

# y: 12 labels (4 samples per class for 3 classes)
y = np.array([0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2], dtype=np.int32)

# Number of instances per class to select
n_k = 2

# Total number of classes
num_classes = 3

# Random seed
seed = 0

# Split type
split = 'balanced'

ARGS = {
    'X': X,
    'y': y,
    'n_k': n_k,
    'num_classes': num_classes,
    'seed': seed,
    'split': split
}
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
FormData Not yet run
unverified (harvested, no recorded run)
yuanjiesh/rc3p/ICP/utils_others.py
code served (permissive licence) · get_code("df0fd09f60a64497")
How it ran

no invocation recorded.

get_logits_targets Not yet run
unverified (harvested, no recorded run)
yuanjiesh/rc3p/ICP/utils_others.py
code served (permissive licence) · get_code("d20cc174be4ee128")
How it ran

no invocation recorded.

load_Emnist Not yet run
unverified (harvested, no recorded run)
yuanjiesh/rc3p/dataset/EMNIST.py
code served (permissive licence) · get_code("e6aa9494b00ba140")
How it ran

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 23 distinct functions with an identity, 10 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 10 later) and 13 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
focal_loss 14 other papers
9 dated earlier, 1 the same month, 4 later
1906.07413 (2019-06)
Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss
2107.09249 (2021-07)
Self-Supervised Aggregation of Diverse Experts for Test-Agnostic Long-Tailed Recognition
and 11 more not named here
resnet32 9 other papers
7 dated earlier, 1 later, 1 same year, order not determinable
1906.07413 (2019-06)
Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss
2104.00466 (2021-04)
Improving Calibration for Long-Tailed Recognition
2106.10891 (2021-06)
Open-set Label Noise Can Improve Robustness Against Inherent Label Noise
and 6 more not named here
accuracy_matrix 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
calc_top_k_accuracy_per_class 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
get_softmax_and_ranks 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
resnet18 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
resnet20 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
resnet20 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
resnet32 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise
resnet44 1 other paper
1 later
2604.06468 (2026-04)
Conformal Margin Risk Minimization: An Envelope Framework for Robust Learning under Label Noise

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

Conformal prediction (CP) is an emerging uncertainty quantification framework that allows us to construct a prediction set to cover the true label with a pre-specified marginal or conditional probability. Although the valid coverage guarantee has been extensively studied for classification problems, CP often produces large prediction sets which may not be practically useful. This issue is exacerbated for the setting of class-conditional coverage on imbalanced classification tasks with many and/or imbalanced classes. This paper proposes the Rank Calibrated Class-conditional CP (RC3P) algorithm to reduce the prediction set sizes to achieve class-conditional coverage, where the valid coverage holds for each class. In contrast to the standard class-conditional CP (CCP) method that uniformly thresholds the class-wise conformity score for each class, the augmented label rank calibration step allows RC3P to selectively iterate this class-wise thresholding subroutine only for a subset of classes whose class-wise top-k error is small. We prove that agnostic to the classifier and data distribution, RC3P achieves class-wise coverage. We also show that RC3P reduces the size of prediction sets compared to the CCP method. Comprehensive experiments on multiple real-world datasets demonstrate that RC3P achieves class-wise coverage and 26.25% reduction in prediction set sizes on average.

For agents

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

get_harvested_code_for_paper("2406.06818")
get_code_for_paper("2406.06818")
have("2406.06818")

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

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

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

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

Connect an agent — have() is free.