SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.08894 · ICLR · 2021

The Intrinsic Dimension of Images and Its Impact on Learning

Micah Goldblum, Tom Goldstein, Ahmed Abdelkader, Chen Zhu, Phillip Pope

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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 1 has no contract verdict; 5 failures of our instrument; 3 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/2104.08894.json · badge: /api/ran/2104.08894.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
ppope/dimensions canonical (classifier label)
classifier basis: classifier_2025
5 ran · 3 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
KNNComputerNoCheck Ran
ran on a synthesized input
ppope/dimensions/estimators/geomle.py
code served (permissive licence) · get_code("5a9384c8c8db2afa")
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 NoneType. 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
from torch import nn

class KNNComputerNoCheck(nn.Module):
    """
    Using this hack for data parallel
    without checking for the sample itself
    """

    def __init__(self, sample_num, K=1, cosine_dist=False):
        super(KNNComputerNoCheck, self).__init__()
        self.K = K
        self.cosine_dist = cosine_dist
        self.register_buffer('num_computed', torch.zeros([]))
        if K == 1:
            self.register_buffer('min_dists', torch.full((sample_num,), float('inf')))
            self.register_buffer('nn_indices', torch.full((sample_num,), 0, dtype=torch.int64))
        else:
            self.register_buffer('min_dists', torch.full((sample_num, K), float('inf')))
            self.register_buffer('nn_indices', torch.full((sample_num, K), 0, dtype=torch.int64))

    def forward(self, x, x_idx_start, y, y_idx_start):
        x_bsize, y_bsize = (x.size(0), y.size(0))
        x = x.view(x_bsize, -1)
        y = y.view(y_bsize, -1)
        if self.cosine_dist:
            x = x / x.norm(dim=1, keepdim=True)
            y = y / y.norm(dim=1, keepdim=True)
            dist = x.mm(y.t())
        else:
            dist = torch.cdist(x, y, p=2, compute_mode='donot_use_mm_for_euclid_dist')
        if self.K == 1:
            new_min_dist, nn_idxes = torch.min(dist, dim=1)
            self.min_dists[x_idx_start:x_idx_start + x_bsize] = torch.min(new_min_dist, self.min_dists[x_idx_start:x_idx_start + x_bsize])
            self.nn_indices[x_idx_start:x_idx_start + x_bsize] = nn_idxes + y_idx_start
        else:
            comp = torch.cat([dist, self.min_dists[x_idx_start:x_idx_start + x_bsize]], dim=1)
            sorted_dists, sorted_idxes = torch.sort(comp, dim=1, descending=False)
            updated_dist_list, nn_idx_list = ([], [])
            for row in range(sorted_dists.shape[0]):
                sidx = 1
                while sidx < sorted_dists.shape[1]:
                    if sorted_dists[row, sidx] == 0:
                        sidx += 1
                    else:
                        break
                updated_dist_list.append(sorted_dists[row, sidx - 1:sidx - 1 + self.K])
                nn_idx_list.append(sorted_idxes[row, sidx - 1:sidx - 1 + self.K])
            updated_min_dist = torch.stack(updated_dist_list)
            nn_idxes = torch.stack(nn_idx_list)
            self.min_dists[x_idx_start:x_idx_start + x_bsize] = updated_min_dist
            sample_idxes = (nn_idxes < y_bsize).int() * (nn_idxes + y_idx_start) + (nn_idxes >= y_bsize).int() * self.nn_indices[x_idx_start:x_idx_start + x_bsize]
            self.nn_indices[x_idx_start:x_idx_start + x_bsize] = sample_idxes

    def get_mean_nn_dist(self, sidx, eidx):
        if self.K == 1:
            return torch.mean(self.min_dists[sidx:eidx])


INIT_ARGS = {
    'sample_num': 8,
    'K': 1,
    'cosine_dist': False
}

ARGS = {
    'x': torch.randn(2, 4),
    'x_idx_start': 0,
    'y': torch.randn(3, 4),
    'y_idx_start': 0
}

if __name__ == '__main__':
    model = KNNComputerNoCheck(**INIT_ARGS)
    model(**ARGS)
    result = model.get_mean_nn_dist(0, 2)
    print(f"Mean NN distance: {result}")
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 NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
drop_zero_values Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from stat-ml/GeoMLE
pointer only · get_code("c3e52574ec7f8090")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

fit_poly_reg Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ppope/dimensions/estimators/geomle.py
code served (permissive licence) · get_code("df7da5b2892df07a")
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; 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 numpy as np

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

# Create small 1D arrays for x and y
x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
y = np.array([2.1, 3.9, 6.2, 7.8, 10.1])

# Create weights array (optional parameter)
w = np.array([1.0, 1.0, 1.0, 1.0, 1.0])

# Define the arguments dictionary
ARGS = {
    'x': x,
    'y': y,
    'w': w,
    'degree': (1, 2),
    'alpha': 0.005
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — 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 — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
intrinsic_dim_sample_wise Ran
ran; our contract draft was wrong, not the code
ppope/dimensions/estimators/mle.py
code served (permissive licence) · get_code("df91d00c39eb470a")
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 ndarray, ndim 1, dtype family float, shape (2,) 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

# Create a distance matrix for k=5 nearest neighbors
# Shape should be (n_samples, k+1) where first column is distance to self (0)
# and remaining k columns are distances to k nearest neighbors
n_samples = 2
k = 5

# Create a distance matrix with proper structure
# First column: distances to self (should be 0 or very small)
# Remaining columns: distances to k nearest neighbors (must be > 0 and increasing)
dist = np.array([
    [0.0, 0.1, 0.2, 0.3, 0.4, 0.5],
    [0.0, 0.15, 0.25, 0.35, 0.45, 0.55]
], dtype=np.float64)

ARGS = {
    "k": 5,
    "dist": dist
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
intrinsic_dim_scale_interval Ran
ran; our contract draft was wrong, not the code
ppope/dimensions/estimators/mle.py
code served (permissive licence) · get_code("71f28a5a636fea5e")
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 list, ndim 1, dtype family float; 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 numpy as np

# Create a distance matrix for k nearest neighbors
# Shape: (n_samples, k_max + 1) where first column is distance to self (0)
# We need at least k2 + 1 columns (k2=20, so 21 columns)
# Let's create 8 samples with distances to 21 nearest neighbors

np.random.seed(0)
n_samples = 8
k_max = 20

# Create a distance matrix where:
# - First column is 0 (distance to self)
# - Subsequent columns are increasing distances (sorted)
dist = np.zeros((n_samples, k_max + 2))
for i in range(n_samples):
    # Generate random distances and sort them
    distances = np.sort(np.random.uniform(0.1, 5.0, k_max + 1))
    dist[i, 1:] = distances

ARGS = {
    "k1": 10,
    "k2": 20,
    "dist": dist
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
mle_center Ran
ran; our contract draft was wrong, not the code
ppope/dimensions/estimators/geomle.py
code served (permissive licence) · get_code("aee171526745aa8a")
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 float; 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 numpy as np

# Create a distance matrix for k=5 nearest neighbors
# Shape: (n_samples, k) where n_samples=2, k=5
# The function will slice it to k=5 columns and perform operations
# dist[:, k-1:k] accesses the last column, dist[:, 0:k-1] accesses first k-1 columns
# So we need at least k columns. The function uses dist[:, -1] as Rs (radii)

k = 5
n_samples = 2

# Create distances that are strictly positive and decrease per row
# Each row represents distances to k nearest neighbors (sorted)
dist = np.array([
    [0.1, 0.2, 0.3, 0.4, 0.5],
    [0.15, 0.25, 0.35, 0.45, 0.55]
], dtype=np.float32)

ARGS = {
    'k': k,
    'dist': dist
}
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 tuple, ndim 2, dtype family float — 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
tolist Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from stat-ml/GeoMLE
pointer only · get_code("a67a7b23ea7331c5")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

_func Not yet run
unverified (harvested, no recorded run)
ppope/dimensions/estimators/geomle.py
code served (permissive licence) · get_code("8f89b37d9005aa30")
How it ran

no invocation recorded.

geomle Not yet run
unverified (harvested, no recorded run)
ppope/dimensions/estimators/geomle.py
code served (permissive licence) · get_code("d52066bee0e04253")
How it ran

no invocation recorded.

update_nn Not yet run
unverified (harvested, no recorded run)
ppope/dimensions/estimators/geomle.py
code served (permissive licence) · get_code("7b18db6c52e2a536")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 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.

FunctionAlso present inEarliest-datedOthers named
drop_zero_values
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1904.06151 (2019-04)
Geometry-Aware Maximum Likelihood Estimation of Intrinsic Dimension
tolist
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1904.06151 (2019-04)
Geometry-Aware Maximum Likelihood Estimation of Intrinsic Dimension

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

It is widely believed that natural image data exhibits low-dimensional structure despite the high dimensionality of conventional pixel representations. This idea underlies a common intuition for the remarkable success of deep learning in computer vision. In this work, we apply dimension estimation tools to popular datasets and investigate the role of low-dimensional structure in deep learning. We find that common natural image datasets indeed have very low intrinsic dimension relative to the high number of pixels in the images. Additionally, we find that low dimensional datasets are easier for neural networks to learn, and models solving these tasks generalize better from training to test data. Along the way, we develop a technique for validating our dimension estimation tools on synthetic data generated by GANs allowing us to actively manipulate the intrinsic dimension by controlling the image generation process. Code for our experiments may be found here.

For agents

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

get_harvested_code_for_paper("2104.08894")
get_code_for_paper("2104.08894")
have("2104.08894")

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

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

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

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

Connect an agent — have() is free.