SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.01026 · 2020

Multi-Center Federated Learning: Clients Clustering for Better Personalization

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure of our instrument; 0 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/2005.01026.json · badge: /api/ran/2005.01026.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
mingxuts/multi-center-fed-learning reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
client_model_factory_fn Ran
ran; our contract draft was wrong, not the code
mingxuts/multi-center-fed-learning/all_baselines/fed-cluster/models/fedcluster.py
code served (permissive licence) · get_code("b4d1b921b49cfd86")
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 function. 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 unittest.mock import MagicMock
import sys

torch.manual_seed(0)

# Create a mock module for 'sent140.bag_dnn'
class MockClientModel:
    def __init__(self, seed, lr, optimizer):
        self.seed = seed
        self.lr = lr
        self.optimizer = optimizer
        self.params = {}
    
    def set_params(self, init_model_params):
        self.params = init_model_params

# Create mock modules
sent140_bag_dnn = MagicMock()
sent140_bag_dnn.ClientModel = MockClientModel

femnist_cnn = MagicMock()
femnist_cnn.ClientModel = MockClientModel

celeba_cnn = MagicMock()
celeba_cnn.ClientModel = MockClientModel

# Register mock modules
sys.modules['sent140.bag_dnn'] = sent140_bag_dnn
sys.modules['sent140'] = MagicMock()
sys.modules['femnist.cnn'] = femnist_cnn
sys.modules['femnist'] = MagicMock()
sys.modules['celeba.cnn'] = celeba_cnn
sys.modules['celeba'] = MagicMock()

# Create args object
class Args:
    def __init__(self, dataset, model, lr=-1):
        self.dataset = dataset
        self.model = model
        self.lr = lr

ARGS = {
    'seed': 42,
    'args': Args(dataset='sent140', model='bag_dnn', lr=-1)
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_similarity Ran
ran, honoured the contract we drafted
mingxuts/multi-center-fed-learning/all_baselines/fed-cluster/models/fedcluster.py
code served (permissive licence) · get_code("b3d657e0309bf67d")
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 float64, 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 numpy as np

# Analyze the function:
# - c1, c2: appear to be identifiers/labels (not used in computation)
# - X_c1, X_c2: passed to distance.cdist, so need to be array-like with shape (n, m)
#   where n is number of samples and m is feature dimension
# - distance.cdist expects 2D arrays
# - Result is a scalar computed from max of cosine distance matrix

# Create small sample data
X_c1 = np.array([[1.0, 0.0, 0.5, 0.2],
                  [0.0, 1.0, 0.3, 0.1]], dtype=np.float64)

X_c2 = np.array([[0.9, 0.1, 0.4, 0.3],
                  [0.1, 0.95, 0.2, 0.15],
                  [0.5, 0.5, 0.7, 0.0]], dtype=np.float64)

c1 = "cluster_1"
c2 = "cluster_2"

ARGS = {
    "c1": c1,
    "c2": c2,
    "X_c1": X_c1,
    "X_c2": X_c2
}
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 float64, 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
relabel_class Ran
ran, honoured the contract we drafted
mingxuts/multi-center-fed-learning/all_baselines/fed-cluster/data/femnist/preprocess/data_to_json.py
code served (permissive licence) · get_code("c05f9655534eb098")
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 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 torch

torch.manual_seed(0)

# The function relabel_class takes a single parameter 'c' which is a hexadecimal class value (string)
# It performs string operations: isdigit(), int() conversions, and hex parsing
# We need to provide valid test cases

# Test cases that cover the three branches:
# 1. Digit case: c is a digit string and int(c) < 40
# 2. Uppercase letter case: hex value <= 90
# 3. Lowercase letter case: hex value > 90

test_cases = [
    "5",      # digit case: isdigit() and int("5") < 40
    "A",      # uppercase letter: int("A", 16) = 10 <= 90
    "1F",     # hex value: int("1F", 16) = 31 <= 90
    "5A",     # hex value: int("5A", 16) = 90 <= 90
    "61",     # hex value: int("61", 16) = 97 > 90
]

# The function takes a single string parameter 'c'
ARGS = {
    "c": "A"
}
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 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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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
client_model_factory_fn 1 other paper
1 later
2108.08647 (2021-08)
Multi-Center Federated Learning: Clients Clustering for Better Personalization
get_similarity 1 other paper
1 later
2108.08647 (2021-08)
Multi-Center Federated Learning: Clients Clustering for Better Personalization
relabel_class 1 other paper
1 later
2206.02078 (2022-06)
Straggler-Resilient Personalized Federated Learning

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.

Abstract

Federated learning has received great attention for its capability to train a large-scale model in a decentralized manner without needing to access user data directly. It helps protect the users' private data from centralized collecting. Unlike distributed machine learning, federated learning aims to tackle non-IID data from heterogeneous sources in various real-world applications, such as those on smartphones. Existing federated learning approaches usually adopt a single global model to capture the shared knowledge of all users by aggregating their gradients, regardless of the discrepancy between their data distributions. However, due to the diverse nature of user behaviors, assigning users' gradients to different global models (i.e., centers) can better capture the heterogeneity of data distributions across users. Our paper proposes a novel multi-center aggregation mechanism for federated learning, which learns multiple global models from the non-IID user data and simultaneously derives the optimal matching between users and centers. We formulate the problem as a joint optimization that can be efficiently solved by a stochastic expectation maximization (EM) algorithm. Our experimental results on benchmark datasets show that our method outperforms several popular federated learning methods.

For agents

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

get_harvested_code_for_paper("2005.01026")
get_code_for_paper("2005.01026")
have("2005.01026")

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

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

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

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

Connect an agent — have() is free.