SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.02609 · CVPR · 2022

Generalized Category Discovery

Kai Han, Andrea Vedaldi, Andrew Zisserman, Sagar Vaze

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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 0 have no contract verdict; 7 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2201.02609.json · badge: /api/ran/2201.02609.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
sgvaze/generalized-category-discovery canonical (classifier label)
classifier basis not recorded on the link
7 ran · 4 no recorded run
FunctionStatusWhere it lives
cluster_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sgvaze/generalized-category-discovery/project_utils/cluster_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from HaiyangZheng/PHE, is pointer only (licence: NONE) · get_code("569a0b5d2369b072")
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 HaiyangZheng/PHE, 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.

drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sgvaze/generalized-category-discovery/models/vision_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from gladzhang/Xformer, is pointer only (licence: NONE) · get_code("55120f2026b56aa2")
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 gladzhang/Xformer, 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.

evaluate_clustering Ran
ran; our contract draft was wrong, not the code
sgvaze/generalized-category-discovery/project_utils/cluster_utils.py
code served (permissive licence) · get_code("15d2b95b53f6db9a")
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

np.random.seed(0)

# Create small synthetic clustering data
n_samples = 50

# y_true: ground truth labels (0, 1, 2)
y_true = np.array([0] * 17 + [1] * 16 + [2] * 17, dtype=int)

# y_pred: predicted labels with some clustering assignments
y_pred = np.array([0] * 16 + [1] * 17 + [2] * 17, dtype=int)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — 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
pairwise_distance Ran
ran; our contract draft was wrong, not the code
sgvaze/generalized-category-discovery/methods/clustering/faster_mix_k_means_pytorch.py
code served (permissive licence) · get_code("980dd2e8fa24f9da")
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 (4, 2) 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 small tensors for pairwise distance computation
# data1: N1 x M matrix (4 points, 3 dimensions)
# data2: N2 x M matrix (2 points, 3 dimensions)
data1 = torch.randn(4, 3)
data2 = torch.randn(2, 3)

ARGS = {
    "data1": data1,
    "data2": data2,
    "batch_size": None,
}
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 (4, 2) — shape (4, 2) 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
purity_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sgvaze/generalized-category-discovery/project_utils/cluster_utils.py
code served (permissive licence) · get_code("1645ca2fb55ce1f8")
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 float64, ndim 0, 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
from sklearn import metrics

# purity_score computes clustering purity by:
# 1. Creating a contingency matrix from y_true and y_pred
# 2. Finding the max value in each column (axis=0)
# 3. Summing those maxes and dividing by total sum
#
# Parameters:
# - y_true: ground truth labels (array-like)
# - y_pred: predicted cluster labels (array-like)

# Create small example data
np.random.seed(0)

# Ground truth labels: 10 samples, 3 true classes
y_true = np.array([0, 0, 0, 0, 1, 1, 1, 2, 2, 2])

# Predicted clusters: 10 samples, 4 predicted clusters
y_pred = np.array([0, 0, 1, 1, 1, 2, 2, 2, 3, 3])

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
strip_state_dict Ran
ran; our contract draft was wrong, not the code
sgvaze/generalized-category-discovery/project_utils/general_utils.py
code served (permissive licence) · get_code("bc2c748ee9fffddf")
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 torch.nn as nn

torch.manual_seed(0)

# Create a sample state_dict with 'module.' prefixed keys
# This simulates a DataParallel model's state_dict
state_dict = {
    'module.layer1.weight': torch.randn(4, 3),
    'module.layer1.bias': torch.randn(4),
    'module.layer2.weight': torch.randn(5, 4),
    'layer3.weight': torch.randn(2, 5),  # Already without 'module.' prefix
}

ARGS = {
    'state_dict': state_dict,
    'strip_key': 'module.'
}
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
transform_moco_state_dict Ran
ran; our contract draft was wrong, not the code
sgvaze/generalized-category-discovery/project_utils/general_utils.py
code served (permissive licence) · get_code("443a6ab0aca3d0e3")
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 torch.nn as nn

torch.manual_seed(0)

# Construct a mock MoCo state dict with the expected structure
# The function expects keys starting with 'module.encoder_q.'
mock_moco_state_dict = {
    'module.encoder_q.conv1.weight': torch.randn(64, 3, 7, 7),
    'module.encoder_q.bn1.weight': torch.randn(64),
    'module.encoder_q.bn1.bias': torch.randn(64),
    'module.encoder_q.layer1.0.conv1.weight': torch.randn(64, 64, 3, 3),
    'module.encoder_q.layer1.0.bn1.weight': torch.randn(64),
    'module.encoder_q.fc.0.weight': torch.randn(2048, 512),
    'module.encoder_q.fc.0.bias': torch.randn(2048),
    'module.encoder_q.fc.1.weight': torch.randn(2048),
    'module.encoder_q.fc.2.weight': torch.randn(128, 2048),
    'module.encoder_q.fc.2.bias': torch.randn(128),
    'other_key.weight': torch.randn(10, 10),  # This will be skipped
}

num_classes = 10

ARGS = {
    'obj': mock_moco_state_dict,
    'num_classes': num_classes,
}
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
get_dino_head_weights Not yet run
unverified (harvested, no recorded run)
sgvaze/generalized-category-discovery/project_utils/general_utils.py
code served (permissive licence) · get_code("aacf96bb3684f3d0")
How it ran

no invocation recorded.

info_nce_logits Not yet run
unverified (harvested, no recorded run)
sgvaze/generalized-category-discovery/methods/contrastive_training/contrastive_training.py
code served (permissive licence) · get_code("77f9f4c0ee87724e")
How it ran

no invocation recorded.

vit_small Not yet run
unverified (harvested, no recorded run)
sgvaze/generalized-category-discovery/models/vision_transformer.py
code served (permissive licence) · get_code("995a10f898196998")
How it ran

no invocation recorded.

vit_tiny Not yet run
unverified (harvested, no recorded run)
sgvaze/generalized-category-discovery/models/vision_transformer.py
code served (permissive licence) · get_code("996780ba4be89ba3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 10 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 10 later) and 1 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
drop_path 224 other papers
18 dated earlier, 4 the same month, 199 later, 2 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
vit_tiny 33 other papers
32 later, 1 undated
2202.11929 (2022-02)
Word Segmentation on Discovered Phone Units with Dynamic Programming and Self-Supervised Scoring
2203.08414 (2022-03)
Unsupervised Semantic Segmentation by Distilling Feature Correspondences
2203.14415 (2022-03)
Mugs: A Multi-Granular Self-Supervised Learning Framework
and 30 more not named here
vit_small 22 other papers
21 later, 1 undated
2202.11929 (2022-02)
Word Segmentation on Discovered Phone Units with Dynamic Programming and Self-Supervised Scoring
2203.08414 (2022-03)
Unsupervised Semantic Segmentation by Distilling Feature Correspondences
2204.07305 (2022-04)
Pushing the Limits of Simple Pipelines for Few-Shot Learning: External Data and Fine-Tuning Make a Difference
and 19 more not named here
cluster_acc 7 other papers
7 later
Du_On-the-Fly_Category_Discovery_CVPR_2023_paper (2023 (year only))
On-the-fly Category Discovery
2305.06144 (2023-05)
Learning Semi-supervised Gaussian Mixture Models for Generalized Category Discovery
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
and 4 more not named here
pairwise_distance 7 other papers
6 later, 1 undated
2212.05590 (2022-12)
PromptCAL: Contrastive Affinity Learning via Auxiliary Prompts for Generalized Novel Category Discovery
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
2310.19776 (2023-10)
Learn to Categorize or Categorize to Learn? Self-Coding for Generalized Category Discovery
and 4 more not named here
purity_score 7 other papers
7 later
Du_On-the-Fly_Category_Discovery_CVPR_2023_paper (2023 (year only))
On-the-fly Category Discovery
2305.06144 (2023-05)
Learning Semi-supervised Gaussian Mixture Models for Generalized Category Discovery
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
and 4 more not named here
evaluate_clustering 5 other papers
5 later
Du_On-the-Fly_Category_Discovery_CVPR_2023_paper (2023 (year only))
On-the-fly Category Discovery
2305.06144 (2023-05)
Learning Semi-supervised Gaussian Mixture Models for Generalized Category Discovery
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
and 2 more not named here
strip_state_dict 4 other papers
1 dated earlier, 3 later
2110.06207 (2021-10)
Open-Set Recognition: A Good Closed-Set Classifier is All You Need
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
and 1 more not named here
transform_moco_state_dict 4 other papers
1 dated earlier, 3 later
2110.06207 (2021-10)
Open-Set Recognition: A Good Closed-Set Classifier is All You Need
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
and 1 more not named here
get_dino_head_weights 3 other papers
3 later
Du_On-the-Fly_Category_Discovery_CVPR_2023_paper (2023 (year only))
On-the-fly Category Discovery
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
2310.19776 (2023-10)
Learn to Categorize or Categorize to Learn? Self-Coding for 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-21.

Repositories linked to this paper

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

For agents

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

get_harvested_code_for_paper("2201.02609")
get_code_for_paper("2201.02609")
have("2201.02609")

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

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

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

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

Connect an agent — have() is free.