SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.00445 · 2020

Learning to Cluster Faces via Confidence and Connectivity Estimation

arXiv · PDF · Open in the Atlas

Code that ran

11 of 15 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, 1 violated it and 9 have no contract verdict; 1 failure of our instrument; 4 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/2004.00445.json · badge: /api/ran/2004.00445.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
yl-1993/learn-to-cluster canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
xiaoxiong74/face-cluster-by-infomap reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
batch_processor Ran
ran on a synthesized input
yl-1993/learn-to-cluster/dsgcn/train_cluster_det.py
code served (permissive licence) · get_code("d1e42462952f4277")
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
from collections import OrderedDict

torch.manual_seed(0)

# Define a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, data, return_loss=False):
        # data is expected to be a list/tuple where data[-1] has length (for len(data[-1]))
        # The function calls model(data, return_loss=True) and expects (_, loss) unpacking
        x = data[0]  # First element is input tensor
        output = self.linear(x)
        loss = output.mean()  # Simple loss computation
        
        if return_loss:
            return output, loss
        return output

# Create model instance
model = MinimalModel()

# Create data - a list where last element has a measurable length
# data should be structured so that len(data[-1]) gives num_samples
# data[0] is the input tensor
input_tensor = torch.randn(2, 4)  # batch_size=2, feature_dim=4
target_tensor = torch.randn(2, 3)  # batch_size=2, output_dim=3
data = [input_tensor, target_tensor]

# train_mode must be True (asserted in function)
train_mode = True

ARGS = {
    'model': model,
    'data': data,
    'train_mode': train_mode,
}
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
calculate_symmetric_dist_row Ran
ran on a synthesized input
yl-1993/learn-to-cluster/baseline/aro.py
code served (permissive licence) · get_code("61d9d93a5700b210")
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 (1, 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 numpy as np

# Analyze the function to understand what it needs:
# - nbrs: a 2D numpy array with shape [n_samples, n_neighbors]
#   Used as: nbrs.shape[1] to get number of neighbors
# - nn_lookup: a dict-like object that maps row indices to neighbor lists
#   Used as: nn_lookup[row_no] to get neighbors, nn_lookup[neighbor] to lookup
#   Returns arrays/lists that support indexing and np.where()
# - row_no: an integer index

# Create a small example with 5 rows and 3 neighbors
nbrs = np.array([
    [0, 1, 2],
    [1, 0, 3],
    [2, 1, 4],
    [3, 0, 2],
    [4, 2, 1]
], dtype=np.int32)

# nn_lookup maps each row index to its neighbors (first element is self-distance/0)
nn_lookup = {
    0: np.array([0, 1, 2]),
    1: np.array([1, 0, 3]),
    2: np.array([2, 1, 4]),
    3: np.array([3, 0, 2]),
    4: np.array([4, 2, 1])
}

# Pick a valid row number (0-4)
row_no = 0

ARGS = {
    "nbrs": nbrs,
    "nn_lookup": nn_lookup,
    "row_no": row_no
}
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 (1, 3) — shape (1, 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
compute_avg_size Ran
ran on a synthesized input
yl-1993/learn-to-cluster/proposals/stat_cluster.py
code served (permissive licence) · get_code("671fbde87ae2e949")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - compute_avg_size takes a parameter 'lst'
# - It checks len(lst) == 0
# - It computes sum(lst) / len(lst)
# - So 'lst' should be a list of numbers (or numeric values that support sum())

# Create a valid argument for lst
lst = [1, 2, 3, 4, 5]

ARGS = {
    "lst": lst
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
coverage Ran
ran on a synthesized input
yl-1993/learn-to-cluster/proposals/stat_cluster.py
code served (permissive licence) · get_code("f011ce5a79dd2638")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function coverage(s, size) expects:
# - s: a set type
# - size: a numeric value (int or float) representing the total size
# The function returns the ratio of set length to size

s = {1, 2, 3, 4, 5}
size = 10

ARGS = {
    "s": s,
    "size": size
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_neighbor_lookup Ran
ran on a synthesized input
yl-1993/learn-to-cluster/baseline/aro.py
code served (permissive licence) · get_code("49ed6fe34473d065")
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)

# The function expects nbrs to be a 2D array-like object with:
# - .shape[0] to get number of rows
# - Indexing with [i, :] to get rows
# We'll create a numpy array or torch tensor with distinct dimensions

nbrs = np.array([
    [0, 1, 2],
    [1, 0, 3],
], dtype=np.int64)

ARGS = {
    "nbrs": nbrs
}
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
filter_clusters Ran
ran on a synthesized input
yl-1993/learn-to-cluster/utils/misc_cluster.py
code served (permissive licence) · get_code("a8370c85b9562d48")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Construct valid arguments for filter_clusters
# The function takes clusters (a list of iterables) and optional min_size and max_size

# Create sample clusters with varying sizes
clusters = [
    [1, 2, 3],           # size 3
    [4, 5],              # size 2
    [6, 7, 8, 9, 10],    # size 5
    [11],                # size 1
    [12, 13, 14, 15],    # size 4
]

ARGS = {
    "clusters": clusters,
    "min_size": 2,
    "max_size": 4,
}
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 — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_cluster_idxs Ran
ran on a synthesized input
yl-1993/learn-to-cluster/utils/misc_cluster.py
code served (permissive licence) · get_code("60febb59c4639544")
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 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - clusters: iterable of iterables (or collections) with len()
# - size: int parameter with default 1
# - The function checks len(c) == size for each cluster c
# - It extends idxs with elements from matching clusters

# Create sample clusters - lists of lists where some have length 1
clusters = [
    [0],           # length 1
    [1, 2],        # length 2
    [3],           # length 1
    [4, 5, 6],     # length 3
    [7],           # length 1
]

ARGS = {
    "clusters": clusters,
    "size": 1
}
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 1, dtype family int — 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
get_majority Ran
ran on a synthesized input
yl-1993/learn-to-cluster/proposals/stat_cluster.py
code served (permissive licence) · get_code("a5cd7a9c6072f6ec")
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 torch
import numpy as np

# The function get_majority takes a dictionary mapping labels to counts
# and returns the label with the maximum count and that count value.
# It iterates through lb2cnt.items(), so we need a dict with label->count mappings.

# Create a simple label-to-count dictionary
lb2cnt = {
    'class_a': 5,
    'class_b': 12,
    'class_c': 3,
    'class_d': 8
}

ARGS = {
    'lb2cnt': lb2cnt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 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
l2norm Ran
ran, violated the contract we drafted
xiaoxiong74/face-cluster-by-infomap/face-cluster-by-infomap.py
pointer only (licence: NONE) · get_code("9e5b9ebb30a1dab5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiaoxiong74/face-cluster-by-infomap 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.

mini_batch_kmeans Ran
ran on a synthesized input
yl-1993/learn-to-cluster/baseline/sklearn_cluster.py
code served (permissive licence) · get_code("ce7e06b25832df77")
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 int, shape (6,) 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 numpy as np
import sklearn.cluster as cluster
import multiprocessing as mp

torch.manual_seed(0)

# Create a small feature array for clustering
# Shape: (n_samples, n_features) = (6, 4)
feat = np.random.randn(6, 4).astype(np.float32)

# Number of clusters
n_clusters = 2

# Batch size for mini-batch k-means
batch_size = 3

ARGS = {
    'feat': feat,
    'n_clusters': n_clusters,
    'batch_size': batch_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — 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 int, shape (6,) — shape (6,) 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
read_meta Ran
ran; our contract draft was wrong, not the code
xiaoxiong74/face-cluster-by-infomap/face-cluster-by-infomap.py
pointer only (licence: NONE) · get_code("b91ea1291400178a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiaoxiong74/face-cluster-by-infomap 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.

build_index Not yet run
unverified (harvested, no recorded run)
yl-1993/learn-to-cluster/baseline/aro.py
code served (permissive licence) · get_code("2a4fdc4d0c86bc3b")
How it ran

no invocation recorded.

intdict2ndarray Not yet run
unverified (harvested, no recorded run)
xiaoxiong74/face-cluster-by-infomap/face-cluster-by-infomap.py
pointer only (licence: NONE) · get_code("7fd66383242447ba")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xiaoxiong74/face-cluster-by-infomap 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. No invocation recorded.

kmeans Not yet run
unverified (harvested, no recorded run)
yl-1993/learn-to-cluster/baseline/sklearn_cluster.py
code served (permissive licence) · get_code("fc332f32dc148ea5")
How it ran

no invocation recorded.

spectral Not yet run
unverified (harvested, no recorded run)
yl-1993/learn-to-cluster/baseline/sklearn_cluster.py
code served (permissive licence) · get_code("073c0bbb90ff55ad")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 12 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
intdict2ndarray 3 other papers
1 dated earlier, 2 later
1904.02749 (2019-04)
Learning to Cluster Faces on an Affinity Graph
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
2404.08995 (2024-04)
Beyond Known Clusters: Probe New Prototypes for Efficient Generalized Class Discovery
l2norm 3 other papers
1 dated earlier, 2 later
1904.02749 (2019-04)
Learning to Cluster Faces on an Affinity Graph
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
2404.08995 (2024-04)
Beyond Known Clusters: Probe New Prototypes for Efficient Generalized Class Discovery
read_meta 3 other papers
1 dated earlier, 2 later
1904.02749 (2019-04)
Learning to Cluster Faces on an Affinity Graph
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
2404.08995 (2024-04)
Beyond Known Clusters: Probe New Prototypes for Efficient Generalized Class 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

Face clustering is an essential tool for exploiting the unlabeled face data, and has a wide range of applications including face annotation and retrieval. Recent works show that supervised clustering can result in noticeable performance gain. However, they usually involve heuristic steps and require numerous overlapped subgraphs, severely restricting their accuracy and efficiency. In this paper, we propose a fully learnable clustering framework without requiring a large number of overlapped subgraphs. Instead, we transform the clustering problem into two sub-problems. Specifically, two graph convolutional networks, named GCN-V and GCN-E, are designed to estimate the confidence of vertices and the connectivity of edges, respectively. With the vertex confidence and edge connectivity, we can naturally organize more relevant vertices on the affinity graph and group them into clusters. Experiments on two large-scale benchmarks show that our method significantly improves clustering accuracy and thus performance of the recognition models trained on top, yet it is an order of magnitude more efficient than existing supervised methods.

For agents

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

get_harvested_code_for_paper("2004.00445")
get_code_for_paper("2004.00445")
have("2004.00445")

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

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

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

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

Connect an agent — have() is free.