SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1806.03198 · 2018

Spreading vectors for similarity search

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 10 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/1806.03198.json · badge: /api/ran/1806.03198.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
lsyhprum/brewess community (classifier label)
classifier basis not recorded on the link
5 ran · 10 no recorded run
FunctionStatusWhere it lives
fetch_SIFT1M Ran
ran on a synthesized input
lsyhprum/brewess/lib/data.py
code served (permissive licence) · get_code("01336cc0613fa115")
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 os
import tempfile
import numpy as np

# Create mock functions that the actual function depends on
def mmap_fvecs(path):
    """Mock function that returns a numpy array like object"""
    # Return a mock array with shape (100, 128) for SIFT vectors
    return np.random.randn(100, 128).astype(np.float32)

def ivecs_read(path):
    """Mock function that reads groundtruth ivecs"""
    # Return a mock array with shape (10, 100) for groundtruth
    return np.random.randint(0, 100, size=(10, 100)).astype(np.int32)

# Inject these functions into the module namespace for fetch_SIFT1M
import sys
current_module = sys.modules[__name__]
current_module.mmap_fvecs = mmap_fvecs
current_module.ivecs_read = ivecs_read

# Create a temporary directory to use as path
temp_dir = tempfile.mkdtemp()

ARGS = {
    'path': temp_dir,
    'train_size': 50,
    'test_size': 75
}
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 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
get_learning_rate Ran
ran on a synthesized input
lsyhprum/brewess/lib/nn_utils.py
code served (permissive licence) · get_code("ea79a3921665cbad")
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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a simple model
model = nn.Linear(4, 3)

# Create an optimizer with a learning rate
optimizer = SGD(model.parameters(), lr=0.01)

# Define arguments for get_learning_rate
ARGS = {
    'optimizer': optimizer
}
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
gumbel_softmax Ran
ran on a synthesized input
lsyhprum/brewess/lib/nn_utils.py
code served (permissive licence) · get_code("63af884f867546da")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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)

# Create a small distribution tensor (batch_size=2, num_categories=4)
dist = torch.randn(2, 4, dtype=torch.float32)

ARGS = {
    "dist": dist,
    "noise": 1.0,
    "hard": True,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
mmap_fvecs Ran
ran, honoured the contract we drafted
lsyhprum/brewess/lib/utils.py
code served (permissive licence) · get_code("37bf4e15693c357b")
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 memmap. 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 numpy as np
import tempfile
import os

# Create a temporary file with valid fvecs format
# fvecs format: first int32 is dimension d, followed by d float32 values, repeat
temp_fd, temp_path = tempfile.mkstemp(suffix='.fvecs')
os.close(temp_fd)

try:
    # Create a small fvecs file
    # Format: [d, v1, v2, ..., vd] repeated for multiple vectors
    d = 4  # dimension
    num_vectors = 2
    
    with open(temp_path, 'wb') as f:
        for _ in range(num_vectors):
            # Write dimension as int32
            np.array([d], dtype='int32').tofile(f)
            # Write d float32 values
            np.array(np.random.randn(d), dtype='float32').tofile(f)
    
    ARGS = {
        'fname': temp_path
    }
finally:
    # Clean up will happen after ARGS is defined
    pass
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 memmap — a memmap output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a memmap output the recorded ndim 2 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
to_one_hot Ran
ran on a synthesized input
lsyhprum/brewess/lib/nn_utils.py
code served (permissive licence) · get_code("b26e044dc568ced8")
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 Tensor, ndim 3, dtype family float, shape (4, 1, 5) 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)

# y: a tensor of class indices
# depth: an integer representing the number of classes
y = torch.tensor([[0], [2], [1], [3]], dtype=torch.int32)  # shape (4, 1)
depth = 5

ARGS = {
    "y": y,
    "depth": depth,
}
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 Tensor, ndim 3, dtype family float, shape (4, 1, 5) — shape (4, 1, 5) 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
fetch_BIGANN1M Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/data.py
code served (permissive licence) · get_code("e94561f6e0e4aa72")
How it ran

no invocation recorded.

fetch_DEEP1M Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/data.py
code served (permissive licence) · get_code("5d8d153339d20b81")
How it ran

no invocation recorded.

is_parametrized Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/parametrize.py
code served (permissive licence) · get_code("c2856de162667599")
How it ran

no invocation recorded.

ivecs_read Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/utils.py
code served (permissive licence) · get_code("7989213dfc5c4cc4")
How it ran

no invocation recorded.

mmap_bvecs Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/utils.py
code served (permissive licence) · get_code("1c59580df5e1f28e")
How it ran

no invocation recorded.

orthogonal Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/parametrizations.py
code served (permissive licence) · get_code("4f8f3d6a905e5ea5")
How it ran

no invocation recorded.

register_parametrization Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/parametrize.py
code served (permissive licence) · get_code("fa9468c52f38c09b")
How it ran

no invocation recorded.

remove_parametrizations Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/parametrize.py
code served (permissive licence) · get_code("cfc6fc75cd26e60f")
How it ran

no invocation recorded.

spectral_norm Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/parametrizations.py
code served (permissive licence) · get_code("1a154a050293ebb3")
How it ran

no invocation recorded.

transpose Not yet run
unverified (harvested, no recorded run)
lsyhprum/brewess/lib/parametrizations.py
code served (permissive licence) · get_code("da917ddc816d2f25")
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, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
mmap_bvecs 2 other papers
2 dated earlier
1609.01882 (2016-09)
Polysemous codes
1702.08734 (2017-02)
Billion-scale similarity search with GPUs
mmap_fvecs 2 other papers
2 dated earlier
1609.01882 (2016-09)
Polysemous codes
1702.08734 (2017-02)
Billion-scale similarity search with GPUs
get_learning_rate 1 other paper
1 later
2004.00345 (2020-04)
Editable Neural Networks
ivecs_read 1 other paper
1 dated earlier
1702.08734 (2017-02)
Billion-scale similarity search with GPUs

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

Discretizing multi-dimensional data distributions is a fundamental step of modern indexing methods. State-of-the-art techniques learn parameters of quantizers on training data for optimal performance, thus adapting quantizers to the data. In this work, we propose to reverse this paradigm and adapt the data to the quantizer: we train a neural net which last layer forms a fixed parameter-free quantizer, such as pre-defined points of a hyper-sphere. As a proxy objective, we design and train a neural network that favors uniformity in the spherical latent space, while preserving the neighborhood structure after the mapping. We propose a new regularizer derived from the Kozachenko--Leonenko differential entropy estimator to enforce uniformity and combine it with a locality-aware triplet loss. Experiments show that our end-to-end approach outperforms most learned quantization methods, and is competitive with the state of the art on widely adopted benchmarks. Furthermore, we show that training without the quantization step results in almost no difference in accuracy, but yields a generic catalyzer that can be applied with any subsequent quantizer.

For agents

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

get_harvested_code_for_paper("1806.03198")
get_code_for_paper("1806.03198")
have("1806.03198")

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

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

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

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

Connect an agent — have() is free.