SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.02735 · 2019

Metric Learning With HORDE: High-Order Regularizer for Deep Embeddings

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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 4 have no contract verdict; 0 failures 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/1908.02735.json · badge: /api/ran/1908.02735.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
pierre-jacob/ICCV2019-Horde canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
make_abe_loss Ran
ran on a synthesized input
pierre-jacob/ICCV2019-Horde/kerastools/losses/iccv2019_loss.py
code served (permissive licence) · get_code("7d92a9a1e0d8d375")
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 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 tensorflow as tf
import numpy as np

# Analyze the function to understand what it needs:
# - n_class: number of classes (used in loops and reshaping)
# - n_ensemble: number of ensemble members (used in loops and reshaping)
# - beta_neg: threshold for negative pairs (float, default 0.5)
# - beta_div: threshold for divergence (float, default 0.5)
# - eps: small epsilon value (float, default 1e-12)
# - lambda_div: weight for divergence loss (float, default 0.5)
# - name: name scope (string, default 'abe_loss')

# The abe_loss function expects:
# - y_true: shape not directly used in the loss computation
# - y_pred: shape [n_class * c, n_ensemble * d] where c and d are inferred from the tensor

# Let's construct reasonable test values:
# n_class = 2 (2 classes)
# n_ensemble = 3 (3 ensemble members)
# c = 2 (2 samples per class)
# d = 4 (embedding dimension)

n_class = 2
n_ensemble = 3
c = 2
d = 4

# y_pred shape should be [n_class * c, n_ensemble * d] = [4, 12]
y_pred = tf.constant(
    np.random.randn(n_class * c, n_ensemble * d).astype(np.float32)
)

# y_true can be dummy data since it's not used in the loss computation
y_true = tf.constant(
    np.zeros((n_class * c, 1)).astype(np.float32)
)

ARGS = {
    'n_class': n_class,
    'n_ensemble': n_ensemble,
    'beta_neg': 0.5,
    'beta_div': 0.5,
    'eps': 1e-12,
    'lambda_div': 0.5,
    'name': 'abe_loss'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
make_multi_class_binomial_deviance Ran
ran on a synthesized input
pierre-jacob/ICCV2019-Horde/kerastools/losses/dml_loss.py
code served (permissive licence) · get_code("e10c8512e9f6e59a")
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 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
tf.random.set_seed(0)

# Define parameters for make_multi_class_binomial_deviance
n_class = 2  # Number of exclusive classes in batch
alpha = 2.0  # Parameter for binomial deviance
beta = 0.5   # Parameter for binomial deviance
cy = 25.0    # Parameter for binomial deviance
sim = 'cosine'  # Similarity measure

# Create valid embeddings
# Batch construction: M exclusive classes, N images per class
# Total samples = n_class * images_per_class
n_images_per_class = 3
total_samples = n_class * n_images_per_class
embedding_dim = 4

# Create random embeddings (normalized for cosine similarity)
embeddings_np = np.random.randn(total_samples, embedding_dim).astype(np.float32)
# Normalize embeddings for cosine similarity
embeddings_np = embeddings_np / (np.linalg.norm(embeddings_np, axis=1, keepdims=True) + 1e-12)

ARGS = {
    'n_class': n_class,
    'alpha': alpha,
    'beta': beta,
    'cy': cy,
    'sim': sim
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
make_multi_class_contrastive_loss Ran
ran on a synthesized input
pierre-jacob/ICCV2019-Horde/kerastools/losses/dml_loss.py
code served (permissive licence) · get_code("4f26b26e102be680")
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 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)

# Create a small batch of embeddings
# The batch must be constructed as: im1_c1, im2_c1, ..., im1_c2, im2_c2, ... imN_cM
# For n_class=2 and c=3 (3 images per class), we need 6 embeddings total
n_class = 2
images_per_class = 3
embedding_dim = 4

# Create random embeddings: shape (6, 4)
# First 3 embeddings from class 1, next 3 from class 2
embeddings = tf.constant(
    np.random.randn(n_class * images_per_class, embedding_dim).astype(np.float32)
)

# Create dummy true labels (not really used by the function, but required by loss signature)
y_true = tf.zeros((n_class * images_per_class,))

ARGS = {
    'n_class': n_class,
    'contrastive_margin': 0.5,
    'epsilon': 1e-12,
    'sim': 'cosine'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
make_multi_class_triplet_loss Ran
ran on a synthesized input
pierre-jacob/ICCV2019-Horde/kerastools/losses/dml_loss.py
code served (permissive licence) · get_code("83696e652600803a")
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 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small test embeddings
# Batch structure: M exclusive classes, N images per class
# Total embeddings: M * N
n_class = 2  # 2 classes
n_images_per_class = 3  # 3 images per class
embedding_dim = 4  # small embedding dimension

# Create embeddings shaped (M*N, embedding_dim) = (6, 4)
# Following the required structure: im1_c1, im2_c1, im3_c1, im1_c2, im2_c2, im3_c2
embeddings_np = np.random.randn(n_class * n_images_per_class, embedding_dim).astype(np.float32)
embeddings = tf.constant(embeddings_np)

# Create dummy y_true (not used in the loss function, but needed for loss signature)
y_true = tf.constant(np.zeros((n_class * n_images_per_class,)), dtype=tf.float32)

# Build arguments for make_multi_class_triplet_loss
ARGS = {
    'n_class': n_class,
    'triplet_margin': 0.1,
    'epsilon': 1e-12,
    'sim': 'cosine'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
Baseline Not yet run
unverified (harvested, no recorded run)
pierre-jacob/ICCV2019-Horde/kerastools/models/dml_models.py
code served (permissive licence) · get_code("4082f06b7564e711")
How it ran

no invocation recorded.

CascadedABE Not yet run
unverified (harvested, no recorded run)
pierre-jacob/ICCV2019-Horde/kerastools/models/horde_models.py
code served (permissive licence) · get_code("fcf67fbb104154cd")
How it ran

no invocation recorded.

CascadedKOrder Not yet run
unverified (harvested, no recorded run)
pierre-jacob/ICCV2019-Horde/kerastools/models/horde_models.py
code served (permissive licence) · get_code("1afe4d22baeab5b8")
How it ran

no invocation recorded.

KOrderModel Not yet run
unverified (harvested, no recorded run)
pierre-jacob/ICCV2019-Horde/kerastools/models/horde_models.py
code served (permissive licence) · get_code("beade91d807dec03")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 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.

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

Learning an effective similarity measure between image representations is key to the success of recent advances in visual search tasks (e.g. verification or zero-shot learning). Although the metric learning part is well addressed, this metric is usually computed over the average of the extracted deep features. This representation is then trained to be discriminative. However, these deep features tend to be scattered across the feature space. Consequently, the representations are not robust to outliers, object occlusions, background variations, etc. In this paper, we tackle this scattering problem with a distribution-aware regularization named HORDE. This regularizer enforces visually-close images to have deep features with the same distribution which are well localized in the feature space. We provide a theoretical analysis supporting this regularization effect. We also show the effectiveness of our approach by obtaining state-of-the-art results on 4 well-known datasets (Cub-200-2011, Cars-196, Stanford Online Products and Inshop Clothes Retrieval).

For agents

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

get_harvested_code_for_paper("1908.02735")
get_code_for_paper("1908.02735")
have("1908.02735")

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

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

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

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

Connect an agent — have() is free.