SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.00617 · AAAI · 2024

Towards Improved Proxy-Based Deep Metric Learning via Data-Augmented Domain Adaptation

Chen Chen, Li Ren, Liqiang Wang, Kien Hua

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 (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 1 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/2401.00617.json · badge: /api/ran/2401.00617.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
noahsark/dada marked official in Papers with Code
Papers with Code archive
6 ran · 1 no recorded run
FunctionStatusWhere it lives
Dis_Predictor Ran
ran on a synthesized input
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("956cc486b4bd52e7")
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 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 as nn

class MockOpt:
    def __init__(self):
        self.active_func = 'relu'
        self.dropout = 0.1
        self.embed_dim = 4
        self.fc_fc1_dim = 8
        self.fc_fc2_dim = 6
        self.n_classes = 3
        self.fc2_bn = True

INIT_ARGS = {
    'opt': MockOpt()
}

ARGS = {
    'x': torch.randn(2, 4)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Uni_Predictor Ran
ran on a synthesized input
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("82f16eb9f1e26661")
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 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 as nn

class Uni_Predictor(nn.Module):

    def __init__(self, opt):
        super(Uni_Predictor, self).__init__()
        self.opt = opt
        if self.opt.active_func == 'relu':
            self.relu = nn.ReLU()
        else:
            self.relu = nn.LeakyReLU()
        self.dropout = nn.Dropout(p=self.opt.dropout)
        self.fc1 = nn.Linear(opt.embed_dim, self.opt.fd_fc1_dim)
        self.bn1_fc = nn.BatchNorm1d(self.opt.fd_fc1_dim)
        self.fc2 = nn.Linear(self.opt.fd_fc1_dim, 3)
        self.bn2_fc = nn.BatchNorm1d(3)

    def forward(self, x):
        x = self.fc1(x)
        x = self.bn1_fc(x)
        x = self.relu(x)
        x = self.fc2(x)
        if self.opt.fd2_bn:
            x = self.bn2_fc(x)
        return x


class OptConfig:
    def __init__(self):
        self.embed_dim = 4
        self.fd_fc1_dim = 8
        self.dropout = 0.1
        self.active_func = 'relu'
        self.fd2_bn = True


INIT_ARGS = {
    'opt': OptConfig()
}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = Uni_Predictor(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
convert_to_pairs Ran
ran, honoured the contract we drafted
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("06241a4008d00a14")
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 2, 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

torch.manual_seed(0)

# Create small label tensors for testing
labels = torch.tensor([0, 1, 0, 1], dtype=torch.long)
ref_labels = torch.tensor([0, 1], dtype=torch.long)

# Create indices tuples for testing different branches
indices_tuple_none = None
indices_tuple_4 = (
    torch.tensor([0, 1], dtype=torch.long),
    torch.tensor([2, 3], dtype=torch.long),
    torch.tensor([1, 0], dtype=torch.long),
    torch.tensor([3, 2], dtype=torch.long)
)
indices_tuple_3 = (
    torch.tensor([0, 1], dtype=torch.long),
    torch.tensor([2, 3], dtype=torch.long),
    torch.tensor([1, 0], dtype=torch.long)
)

ARGS = {
    "indices_tuple": indices_tuple_none,
    "labels": labels,
    "ref_labels": ref_labels
}
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 tuple, ndim 2, dtype family int — 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
get_all_pairs_indices Ran
ran; our contract draft was wrong, not the code
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("9ef2ef645b3e755a")
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. 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

torch.manual_seed(0)

# Create small label tensors for testing
# labels: tensor of class labels for samples
labels = torch.tensor([0, 1, 0, 2], dtype=torch.long)

# ref_labels: optional reference labels (can be None or another tensor)
# When None, the function uses labels as ref_labels
ref_labels = None

ARGS = {
    "labels": labels,
    "ref_labels": ref_labels,
}
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 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
get_matches_and_diffs Ran
ran; our contract draft was wrong, not the code
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("719dc7f066aa3b2f")
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 3, 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

torch.manual_seed(0)

# The function expects:
# - labels: a tensor that supports .unsqueeze() and .fill_diagonal_() operations
# - ref_labels: optional tensor (defaults to labels if None)
# Both are compared with == and ^ operations, so they should be integer tensors

labels = torch.tensor([0, 1, 2, 1], dtype=torch.long)
ref_labels = None

ARGS = {
    "labels": labels,
    "ref_labels": ref_labels,
}
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 tuple, ndim 3, dtype family int — 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
get_pos_pairs Ran
ran; our contract draft was wrong, not the code
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("2ea2d6e75fab74dd")
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 2, 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)

# Create small tensors for testing
# indices_tuple: tuple of 1d tensors specifying indices within a batch
# For the 3-tuple case (a, p, n), we need anchor, positive, and negative indices
batch_size = 4
a_indices = torch.tensor([0, 1, 2])  # anchor indices
p_indices = torch.tensor([1, 0, 3])  # positive indices
n_indices = torch.tensor([2, 3, 1])  # negative indices
indices_tuple = (a_indices, p_indices, n_indices)

# labels: tensor with label for each element in batch
# We need labels that make sense with the indices above
labels = torch.tensor([0, 0, 1, 1])

ARGS = {
    "indices_tuple": indices_tuple,
    "labels": labels,
}
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 2, dtype family int — 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
Criterion Not yet run
unverified (harvested, no recorded run)
noahsark/dada/criteria/dadaproxy.py
code served (permissive licence) · get_code("c68928c620a7b621")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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.

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

Deep Metric Learning (DML) plays an important role in modern computer vision research, where we learn a distance metric for a set of image representations. Recent DML techniques utilize the proxy to interact with the corresponding image samples in the embedding space. However, existing proxybased DML methods focus on learning individual proxy-tosample distance, while the overall distribution of samples and proxies lacks attention. In this paper, we present a novel proxy-based DML framework that focuses on aligning the sample and proxy distributions to improve the efficiency of proxy-based DML losses. Specifically, we propose the Data-Augmented Domain Adaptation (DADA) method to adapt the domain gap between the group of samples and proxies. To the best of our knowledge, we are the first to leverage domain adaptation to boost the performance of proxy-based DML. We show that our method can be easily plugged into existing proxy-based DML losses. Our experiments on benchmarks, including the popular CUB-200-2011, CARS196, Stanford Online Products, and In-Shop Clothes Retrieval, show that our learning algorithm significantly improves the existing proxy losses and achieves superior results compared to the existing methods.

For agents

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

get_harvested_code_for_paper("2401.00617")
get_code_for_paper("2401.00617")
have("2401.00617")

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

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

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

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

Connect an agent — have() is free.