SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.02998 · ICLR · 2025

Towards Calibrated Deep Clustering Network

Junhui Hou, Hui Liu, Yuheng Jia, Jianhong Cheng

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2403.02998.json · badge: /api/ran/2403.02998.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
ChengJianH/CDC marked official in Papers with Code
Papers with Code archive
6 ran · 1 no recorded run
FunctionStatusWhere it lives
BasicClustering Ran
ran on a synthesized input · constructed an object; no result was computed
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("5bbebd592ab6f00f")
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 an instance of its own class, BasicClustering: the run constructed the object and did not call it, so no result was computed. 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.distributed as dist

torch.manual_seed(0)

ARGS = {
    'n_clusters': 3,
    'init': 'k-means++',
    'n_init': 10,
    'random_state': 0,
    'max_iter': 300,
    'tol': 0.0001,
    'distributed': False,
    'verbose': True,
}
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 BasicClustering — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BasicClustering 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
PyTorchKMeans Ran
ran on a synthesized input · constructed an object; no result was computed
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("d1bd5b90e9e57d4c")
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 an instance of its own class, PyTorchKMeans: the run constructed the object and did not call it, so no result was computed. 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
import torch.distributed as dist

torch.manual_seed(0)
np.random.seed(0)

# Create small sample data
n_samples = 8
n_features = 4
X = torch.randn(n_samples, n_features, dtype=torch.float32)

# Create ARGS dict with all parameters for BasicClustering.__init__
ARGS = {
    'n_clusters': 3,
    'init': 'k-means++',
    'n_init': 2,
    'random_state': 0,
    'max_iter': 10,
    'tol': 0.0001,
    'distributed': False,
    'verbose': True,
}
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 PyTorchKMeans — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PyTorchKMeans 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
_kmeans_plusplus Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("4aa2e08b1b713db1")
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 numpy as np

torch.manual_seed(0)

# Create a small dataset: 2 samples, 4 features
X = torch.randn(2, 4, dtype=torch.float32)

# Define the pairwise_distance function
# It should take two tensors and return distances
def pairwise_distance(x, y):
    # x shape: (n, features), y shape: (m, features)
    # return shape: (n, m) or (m,) depending on input
    if x.shape[0] == 1:
        # Broadcasting case for single center
        return torch.cdist(x, y).squeeze(0)
    else:
        # Multiple centers
        return torch.cdist(x, y)

n_clusters = 2
random_state = 42
n_local_trials = 3

ARGS = {
    'X': X,
    'n_clusters': n_clusters,
    'random_state': random_state,
    'pairwise_distance': pairwise_distance,
    'n_local_trials': n_local_trials,
}
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 — 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
pairwise_cosine Ran
ran; our contract draft was wrong, not the code
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("c0a56261751a7cb8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create two small tensors with distinct dimensions
# x1: batch_size=2, embedding_dim=4
# x2: batch_size=3, embedding_dim=4 (different batch size for pairwise operation)
x1 = torch.randn(2, 4)
x2 = torch.randn(3, 4)

ARGS = {
    "x1": x1,
    "x2": x2,
    "pairwise": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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
pairwise_euclidean Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("2ebcdcd274d9b3c9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create two small tensors for pairwise euclidean distance computation
# x1: shape (2, 4) - 2 points in 4-dimensional space
# x2: shape (3, 4) - 3 points in 4-dimensional space
x1 = torch.randn(2, 4)
x2 = torch.randn(3, 4)

ARGS = {
    "x1": x1,
    "x2": x2,
    "pairwise": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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
stable_cumsum Ran
ran; our contract draft was wrong, not the code
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("500990b89c506e5c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (8,) 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 warnings

torch.manual_seed(0)

# Create a small tensor for testing stable_cumsum
arr = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                     [5.0, 6.0, 7.0, 8.0]])

ARGS = {
    "arr": arr,
    "dim": None,
    "rtol": 1e-05,
    "atol": 1e-08
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (8,) — shape (8,) 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
train_cali Not yet run
unverified (harvested, no recorded run)
ChengJianH/CDC/cdc/methods/calibrate_train.py
code served (permissive licence) · get_code("718dbd399e4c0dcc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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, 0 later) and 5 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
pairwise_cosine
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2312.07806 (2023-12)
Contextually Affinitive Neighborhood Refinery for Deep Clustering
pairwise_euclidean
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2312.07806 (2023-12)
Contextually Affinitive Neighborhood Refinery for Deep Clustering

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Deep clustering has exhibited remarkable performance; however, the overconfidence problem, i.e., the estimated confidence for a sample belonging to a particular cluster greatly exceeds its actual prediction accuracy, has been overlooked in prior research. To tackle this critical issue, we pioneer the development of a calibrated deep clustering framework. Specifically, we propose a novel dualhead (calibration head and clustering head) deep clustering model that can effectively calibrate the estimated confidence and the actual accuracy. The calibration head adjusts the overconfident predictions of the clustering head, generating prediction confidence that matches the model learning status. Then, the clustering head dynamically selects reliable high-confidence samples estimated by the calibration head for pseudo-label self-training. Additionally, we introduce an effective network initialization strategy that enhances both training speed and network robustness. The effectiveness of the proposed calibration approach and initialization strategy are both endorsed with solid theoretical guarantees. Extensive experiments demonstrate the proposed calibrated deep clustering model not only surpasses the state-of-the-art deep clustering methods by 5× on average in terms of expected calibration error, but also significantly outperforms them in terms of clustering accuracy. Code is available at https://github.com/ChengJianH/CDC.

For agents

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

get_harvested_code_for_paper("2403.02998")
get_code_for_paper("2403.02998")
have("2403.02998")

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

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

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

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

Connect an agent — have() is free.