SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.04272 · CVPR · 2024

Active Generalized Category Discovery

Zhun Zhong, Fei Zhu, Xu-Yao Zhang, Shijie Ma, Cheng-Lin Liu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 5 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/2403.04272.json · badge: /api/ran/2403.04272.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
mashijie1028/activegcd marked official in Papers with Code
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
SupConLoss Ran
ran on a synthesized input
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("300b0f6e28f50218")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, 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 numpy as np

INIT_ARGS = {
    "temperature": 0.1,
    "contrast_mode": "all",
    "base_temperature": 0.1
}

# Create a small batch of features: [batch_size=2, n_views=3, feature_dim=4]
batch_size = 2
n_views = 3
feature_dim = 4
features = torch.randn(batch_size, n_views, feature_dim)

# Create labels for supervised contrastive loss
labels = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "features": features,
    "labels": labels,
    "mask": None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
get_labeled_mapping Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("20a7085020118ffa")
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
import numpy as np

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self, num_classes=5):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        # Function expects model to return 3 values: (_, _, logits)
        logits = self.fc(x)
        return None, None, logits

# Create minimal data loaders as lists of tuples (images, label, _)
def create_loader(num_samples=4, num_classes=5):
    loader = []
    for i in range(num_samples):
        images = torch.randn(2, 4)  # batch_size=2, feature_dim=4
        label = torch.randint(0, num_classes, (2,))
        other = None
        loader.append((images, label, other))
    return loader

# Create model and loaders
model = MinimalModel(num_classes=5)

train_labeled_loader_mapping = create_loader(num_samples=2, num_classes=5)
al_labeled_loader_mapping = create_loader(num_samples=2, num_classes=5)

# Create args dict with required attributes
class Args:
    def __init__(self):
        self.num_labeled_classes = 3
        self.num_unlabeled_classes = 2

args = Args()

ARGS = {
    'model': model,
    'train_labeled_loader_mapping': train_labeled_loader_mapping,
    'al_labeled_loader_mapping': al_labeled_loader_mapping,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch, tqdm — 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
log_accs_from_preds Ran
ran; our contract draft was wrong, not the code
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("bb888e18889d0163")
How it ran

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

import numpy as np

# Create small numpy arrays for the function parameters
np.random.seed(0)

# Create ground truth labels - 10 samples with 4 classes (0, 1, 2, 3)
y_true = np.array([0, 0, 1, 1, 2, 2, 3, 3, 0, 1], dtype=np.int32)

# Create predicted labels - same shape as y_true
y_pred = np.array([0, 0, 1, 1, 2, 3, 3, 2, 0, 1], dtype=np.int32)

# Create mask - True for old classes (indices 0-5), False for new classes (indices 6-9)
mask = np.array([True, True, True, True, True, True, False, False, True, True], dtype=bool)

# Evaluation function names
eval_funcs = ['v2', 'v2b']

# Save name for logging
save_name = 'test_eval'

# Optional parameters
T = 1
print_output = True
args = None

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
    'mask': mask,
    'eval_funcs': eval_funcs,
    'save_name': save_name,
    'T': T,
    'print_output': print_output,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
map_labels Ran
ran; our contract draft was wrong, not the code
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("ec7d8c7bbd17eaa8")
How it ran

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

torch.manual_seed(0)

# Create original_labels as a tensor
original_labels = torch.tensor([0, 1, 2, 1], dtype=torch.long)

# Create ind_map as a dictionary mapping original label indices to new labels
ind_map = {
    0: 10,
    1: 20,
    2: 30
}

ARGS = {
    "original_labels": original_labels,
    "ind_map": ind_map
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 int, shape (4,) — shape (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
split_cluster_acc_v2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("21b51b923477b0ce")
How it ran

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

import numpy as np

# Create small numpy arrays for testing
np.random.seed(0)

# y_true: true labels, shape (n_samples,)
# Let's create 10 samples with 3 classes (0, 1, 2)
y_true = np.array([0, 0, 1, 1, 2, 2, 0, 1, 2, 0], dtype=int)

# y_pred: predicted labels, shape (n_samples,)
# Create predictions that are somewhat aligned with true labels
y_pred = np.array([0, 0, 1, 1, 2, 2, 0, 1, 2, 0], dtype=int)

# mask: boolean array indicating which instances are from old classes (True) 
# and which are from new classes (False)
# Let's say first 6 samples are from old classes, last 4 are from new classes
mask = np.array([True, True, True, True, True, True, False, False, False, False], dtype=bool)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_cluster_acc_v2_balanced Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("70bddc068d650d19")
How it ran

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

import numpy as np

# Create small numpy arrays for testing
np.random.seed(0)

# y_true: ground truth labels, shape (n_samples,)
# Let's create 10 samples with labels 0-3
y_true = np.array([0, 0, 1, 1, 2, 2, 3, 3, 0, 1], dtype=int)

# y_pred: predicted labels, shape (n_samples,)
# Create predictions that are somewhat correlated with ground truth
y_pred = np.array([0, 0, 1, 1, 2, 3, 3, 2, 0, 1], dtype=int)

# mask: boolean array indicating old classes (True) vs new classes (False)
# First 6 samples are from old classes, last 4 are from new classes
mask = np.array([True, True, True, True, True, True, False, False, False, False], dtype=bool)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
test_al Not yet run
unverified (harvested, no recorded run)
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("603c48d8426e38b8")
How it ran

no invocation recorded.

train_al_ema Not yet run
unverified (harvested, no recorded run)
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("75381d9269f22be2")
How it ran

no invocation recorded.

update_ema_variables Not yet run
unverified (harvested, no recorded run)
mashijie1028/activegcd/utils_al/train_recipes_ema.py
code served (permissive licence) · get_code("e253169eb9c23d84")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
SupConLoss
brick of this paper's assembly: loss
1 other paper
1 dated earlier
2310.01376 (2023-10)
Towards Distribution-Agnostic Generalized Category Discovery

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

Figure 1. The diagram of three settings. Left: Conventional AL is a closed-world setting, where labeled and unlabeled classes are identical. Middle: GCD requires no active labeling and suffers from severe issues. Right: AGCD is an open-world extrapolated version of AL, where unlabeled data contains novel categories, and models are trained on both labeled and unlabeled data to cluster both old and new classes.

For agents

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

get_harvested_code_for_paper("2403.04272")
get_code_for_paper("2403.04272")
have("2403.04272")

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

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

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

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

Connect an agent — have() is free.