SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.00292 · 2019

AdaCos: Adaptively Scaling Cosine Logits for Effectively Learning Deep Face Representations

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 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 3 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/1905.00292.json · badge: /api/ran/1905.00292.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
samisoto/keras_cosine_based_loss community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
4uiiurz1/pytorch-adacos reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 2 no recorded run
FunctionStatusWhere it lives
crop_box_ratio Ran
ran on a synthesized input
samisoto/keras_cosine_based_loss/experiment_caltech_birds.py
code served (permissive licence) · get_code("0709482d4c4fce79")
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 EagerTensor, ndim 3, dtype family int, shape (2, 3, 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 tensorflow as tf
import numpy as np

# Create a small test image (height=4, width=6, channels=3)
image = tf.constant(np.random.randint(0, 256, (4, 6, 3), dtype=np.uint8), dtype=tf.uint8)

# Create a bounding box in normalized coordinates [y_min, x_min, y_max, x_max]
# This box represents a region from 25% to 75% in both dimensions
bbox = tf.constant([0.25, 0.25, 0.75, 0.75], dtype=tf.float32)

ARGS = {
    "image": image,
    "bbox": bbox
}
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 EagerTensor, ndim 3, dtype family int, shape (2, 3, 3) — shape (2, 3, 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
random_crop Ran
ran on a synthesized input
samisoto/keras_cosine_based_loss/experiment_caltech_birds.py
code served (permissive licence) · get_code("1313f4e6ea0381c4")
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 EagerTensor, ndim 3, dtype family float, shape (1, 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 tensorflow as tf

# Test with a 3D image tensor (height, width, channels)
image_3d = tf.constant([[[1, 2, 3], [4, 5, 6]], 
                         [[7, 8, 9], [10, 11, 12]]], dtype=tf.float32)

# Test with a 4D batch of images (batch, height, width, channels)
image_4d = tf.constant([[[[1, 2, 3], [4, 5, 6]], 
                          [[7, 8, 9], [10, 11, 12]]],
                         [[[13, 14, 15], [16, 17, 18]], 
                          [[19, 20, 21], [22, 23, 24]]]], dtype=tf.float32)

ARGS = {
    "image": image_3d,
    "minval": 0.8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (1, 1, 3) — shape (1, 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
true_label_preprocess Ran
ran on a synthesized input
samisoto/keras_cosine_based_loss/experiment_caltech_birds.py
code served (permissive licence) · get_code("64d416bfc2f31ec2")
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. 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

# Create small sample tensors
image = tf.constant(np.random.randn(2, 4).astype(np.float32))
label = tf.constant(np.array([0, 1], dtype=np.int32))

ARGS = {
    "image": image,
    "label": label
}
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 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
train Not yet run
unverified (harvested, no recorded run)
4uiiurz1/pytorch-adacos/mnist_train.py
code served (permissive licence) · get_code("98eca2af137cb478")
How it ran

no invocation recorded.

validate Not yet run
unverified (harvested, no recorded run)
4uiiurz1/pytorch-adacos/mnist_train.py
code served (permissive licence) · get_code("59a7b219c2dfeae3")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

The cosine-based softmax losses and their variants achieve great success in deep learning based face recognition. However, hyperparameter settings in these losses have significant influences on the optimization path as well as the final recognition performance. Manually tuning those hyperparameters heavily relies on user experience and requires many training tricks. In this paper, we investigate in depth the effects of two important hyperparameters of cosine-based softmax losses, the scale parameter and angular margin parameter, by analyzing how they modulate the predicted classification probability. Based on these analysis, we propose a novel cosine-based softmax loss, AdaCos, which is hyperparameter-free and leverages an adaptive scale parameter to automatically strengthen the training supervisions during the training process. We apply the proposed AdaCos loss to large-scale face verification and identification datasets, including LFW, MegaFace, and IJB-C 1:1 Verification. Our results show that training deep neural networks with the AdaCos loss is stable and able to achieve high face recognition accuracy. Our method outperforms state-of-the-art softmax losses on all the three datasets.

For agents

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

get_harvested_code_for_paper("1905.00292")
get_code_for_paper("1905.00292")
have("1905.00292")

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

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

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

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

Connect an agent — have() is free.