SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.06991 · 2019

Improved Precision and Recall Metric for Assessing Generative Models

Tero Karras, Jaakko Lehtinen, Tuomas Kynkäänniemi, Timo Aila, Samuli Laine

arXiv · PDF · Open in the Atlas

Code that ran

30 of 42 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (12 of them constructed an object rather than computing a result; 5 honoured the contract we drafted, 1 violated it and 14 have no contract verdict; 10 failures of our instrument; 12 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/1904.06991.json · badge: /api/ran/1904.06991.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
AlexVerine/PrecisionRecallGan community
Papers with Code archive
8 ran · 1 no recorded run
toshas/torch-fidelity community
Papers with Code archive
4 ran · 3 no recorded run
youngjung/improved-precision-and-recall-metric-pytorch community
Papers with Code archive
4 ran · 1 no recorded run
thomaskerdreux/pdm_sar_insar_generation community
Papers with Code archive
3 ran · 2 no recorded run
psanch21/imp_bigan community
Papers with Code archive
3 ran · 1 no recorded run
blandocs/improved-precision-and-recall-metric-pytorch community
Papers with Code archive
3 ran · 0 no recorded run
manicman1999/precision-recall-keras community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
kynkaat/improved-precision-and-recall-metric marked official in Papers with Code
Papers with Code archive
1 ran · 3 no recorded run
marcojira/fld community
Papers with Code archive
1 ran · 1 no recorded run
FunctionStatusWhere it lives
DistanceBlock Ran
ran on a synthesized input · constructed an object; no result was computed
psanch21/imp_bigan/utils/precision_recall/precision_recall.py
code served (permissive licence) · get_code("31d95e8ba2daecb1")
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 an instance of its own class, DistanceBlock: the run constructed the object and did not call it, so no result was computed. 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

tf.compat.v1.disable_eager_execution()

ARGS = {
    'num_features': 4,
    'num_gpus': 1,
}
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 DistanceBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DistanceBlock 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
FileNames Ran
ran on a synthesized input · constructed an object; no result was computed
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("063f56b6465178ad")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

IPR Ran
ran on a synthesized input · constructed an object; no result was computed
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("f1bd04eed1f7e173")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

IPR Ran
ran on a synthesized input · constructed an object; no result was computed
youngjung/improved-precision-and-recall-metric-pytorch/improved_precision_recall.py
code served (permissive licence) · get_code("3a19d7da570f0451")
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 an instance of its own class, IPR: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
import numpy as np
from collections import namedtuple

torch.manual_seed(0)

# Create a minimal VGG16-like model that satisfies the interface
class MinimalVGG16(nn.Module):
    def __init__(self):
        super().__init__()
        self.features = nn.Sequential(
            nn.Conv2d(3, 8, kernel_size=3),
            nn.ReLU(inplace=True),
            nn.MaxPool2d(kernel_size=2, stride=2),
        )
        self.avgpool = nn.AdaptiveAvgPool2d((7, 7))
        self.classifier = nn.Sequential(
            nn.Linear(8 * 7 * 7, 64),
            nn.ReLU(inplace=True),
            nn.Linear(64, 4),
        )
    
    def forward(self, x):
        x = self.features(x)
        x = self.avgpool(x)
        x = torch.flatten(x, 1)
        x = self.classifier(x)
        return x
    
    def eval(self):
        super().eval()
        return self

# Create model instance
model = MinimalVGG16()
model.eval()

# Define ARGS
ARGS = {
    'batch_size': 2,
    'k': 3,
    'num_samples': 10,
    'model': model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type IPR — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a IPR 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
ImageDataset Ran
ran on a synthesized input · constructed an object; no result was computed
blandocs/improved-precision-and-recall-metric-pytorch/functions.py
pointer only (licence: NONE) · get_code("64368fff5c6334de")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, blandocs/improved-precision-and-recall-metric-pytorch when it was checked. 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.

ImageFolder Ran
ran on a synthesized input · constructed an object; no result was computed
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("c10080ea2e34a27c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

ImageFolder Ran
ran on a synthesized input · constructed an object; no result was computed
youngjung/improved-precision-and-recall-metric-pytorch/improved_precision_recall.py
code served (permissive licence) · get_code("3cf0aadecce9d196")
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 an instance of its own class, ImageFolder: the run constructed the object and did not call it, so no result was computed. 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
from PIL import Image
import torch

# Create a temporary directory with some test images
temp_dir = tempfile.mkdtemp()

# Create a simple test image and save it
test_image = Image.new('RGB', (10, 10), color='red')
test_image.save(os.path.join(temp_dir, 'test1.jpg'))

test_image2 = Image.new('RGB', (10, 10), color='blue')
test_image2.save(os.path.join(temp_dir, 'test2.png'))

# Create a simple transform callable that does nothing
class SimpleTransform:
    def __call__(self, image):
        return image

transform = SimpleTransform()

# Define arguments for ImageFolder
ARGS = {
    'root': temp_dir,
    'transform': transform
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ImageFolder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ImageFolder output the recorded ndim 4 and dtype family int 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
ManifoldEstimator Ran
ran on a synthesized input · constructed an object; no result was computed
psanch21/imp_bigan/utils/precision_recall/precision_recall.py
code served (permissive licence) · get_code("323cbfbab4a149aa")
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 an instance of its own class, ManifoldEstimator: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf


class MockDistanceBlock:
    """Mock distance block that computes pairwise Euclidean distances."""
    
    def pairwise_distances(self, row_batch, col_batch):
        """Compute pairwise distances between row_batch and col_batch."""
        # row_batch: (N, D), col_batch: (M, D)
        # Returns: (N, M) distance matrix
        row_batch = np.array(row_batch, dtype=np.float32)
        col_batch = np.array(col_batch, dtype=np.float32)
        
        # Compute Euclidean distances
        # ||a - b||^2 = ||a||^2 + ||b||^2 - 2*a*b
        row_sq = np.sum(row_batch ** 2, axis=1, keepdims=True)  # (N, 1)
        col_sq = np.sum(col_batch ** 2, axis=1, keepdims=True).T  # (1, M)
        cross = np.dot(row_batch, col_batch.T)  # (N, M)
        
        distances = np.sqrt(np.maximum(row_sq + col_sq - 2 * cross, 0))
        return distances.astype(np.float16)


# Create small feature vectors
np.random.seed(42)
num_ref_features = 10
feature_dim = 4
num_eval_features = 5

# Reference features for training the manifold
ref_features = np.random.randn(num_ref_features, feature_dim).astype(np.float32)

# Evaluation features
eval_features = np.random.randn(num_eval_features, feature_dim).astype(np.float32)

# Create distance block
distance_block = MockDistanceBlock()

ARGS = {
    "distance_block": distance_block,
    "features": ref_features,
    "row_batch_size": 5,
    "col_batch_size": 5,
    "nhood_sizes": [2, 3],
    "clamp_to_percentile": None,
    "eps": 1e-05
}
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 ManifoldEstimator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ManifoldEstimator 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
ManifoldEstimator Ran
ran on a synthesized input · constructed an object; no result was computed
kynkaat/improved-precision-and-recall-metric/precision_recall.py
pointer only (licence: NONE) · get_code("5116b2e12b5213dd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kynkaat/improved-precision-and-recall-metric when it was checked. 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.

PrecisionRecall Ran
ran on a synthesized input · constructed an object; no result was computed
marcojira/fld/fld/metrics/PrecisionRecall.py
pointer only (licence: NONE) · get_code("8b8e982a58d7c4bd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, marcojira/fld when it was checked. 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.

batch_pairwise_distances Ran
ran, honoured the contract we drafted
psanch21/imp_bigan/utils/precision_recall/precision_recall.py
code served (permissive licence) · get_code("14c485bafef2920e")
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 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
np.random.seed(0)
tf.compat.v1.set_random_seed(0)

# Create small feature vectors for U and V
# U: batch_size=2, feature_dim=4
U_data = np.random.randn(2, 4).astype(np.float32)
U = tf.constant(U_data)

# V: batch_size=3, feature_dim=4 (different batch size to show distinction)
V_data = np.random.randn(3, 4).astype(np.float32)
V = tf.constant(V_data)

ARGS = {
    'U': U,
    'V': V
}
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 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: none by the harness; any seed is in the setup block
batch_pairwise_distances Ran
ran, honoured the contract we drafted
thomaskerdreux/pdm_sar_insar_generation/utils/utils_precision_and_recall.py
code served (permissive licence) · get_code("8e2d8c2ab95b9ced")
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, 3) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# The function computes pairwise distances between two batches of feature vectors.
# It expects:
# - U: a tensor of shape (batch_size_u, feature_dim)
# - V: a tensor of shape (batch_size_v, feature_dim)
# Both should be 2D tensors of floats.

# Create two small batches of feature vectors
U = torch.randn(2, 4, dtype=torch.float32)  # batch_size=2, feature_dim=4
V = torch.randn(3, 4, dtype=torch.float32)  # batch_size=3, feature_dim=4

ARGS = {
    "U": U,
    "V": V,
}
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, 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: none by the harness; any seed is in the setup block
calc_cdist_full Ran
ran; our contract draft was wrong, not the code
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("0920b80eb6e4e57f")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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.

calc_cdist_part Ran
ran; our contract draft was wrong, not the code
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("7d555d449583cad9")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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.

calculate_precision_recall_part Ran
ran; our contract draft was wrong, not the code
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("fe34b19b6900c3ca")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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.

compute_metric Ran
ran; our contract draft was wrong, not the code
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("88c7b603b76960ad")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

compute_pairwise_distances Ran
ran, honoured the contract we drafted
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("462603bdd8ffe544")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

compute_pairwise_distances Ran
ran, honoured the contract we drafted
youngjung/improved-precision-and-recall-metric-pytorch/improved_precision_recall.py
code served (permissive licence) · get_code("af985ecf236605b0")
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 ndarray, 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 numpy as np

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

# Create small numpy arrays for testing
# X: shape (2, 4) - 2 samples, 4 dimensions
X = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float64)

# Y: shape (3, 4) - 3 samples, 4 dimensions (different from X to show non-square output)
Y = np.array([
    [1.5, 2.5, 3.5, 4.5],
    [5.5, 6.5, 7.5, 8.5],
    [9.0, 10.0, 11.0, 12.0]
], dtype=np.float64)

ARGS = {
    "X": X,
    "Y": Y
}
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 ndarray, 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: none by the harness; any seed is in the setup block
distances2radii Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("321ebed484cb3298")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

feature_extractor Ran
ran on a synthesized input · constructed an object; no result was computed
blandocs/improved-precision-and-recall-metric-pytorch/functions.py
pointer only (licence: NONE) · get_code("5bee49623aae7bf9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, blandocs/improved-precision-and-recall-metric-pytorch when it was checked. 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.

get_custom_loader Ran
ran; our contract draft was wrong, not the code
youngjung/improved-precision-and-recall-metric-pytorch/improved_precision_recall.py
code served (permissive licence) · get_code("d4d53047a22471be")
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 DataLoader. 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
from PIL import Image
import torch
from torchvision import transforms

torch.manual_seed(0)

# Create a temporary directory with test images
temp_dir = tempfile.mkdtemp()
for i in range(3):
    img = Image.new('RGB', (100, 100), color=(i*50, i*80, i*100))
    img.save(os.path.join(temp_dir, f'test_{i}.jpg'))

# Create a list of image file paths
test_image_paths = [os.path.join(temp_dir, f'test_{i}.jpg') for i in range(3)]

# Define ARGS dictionary with all parameters for get_custom_loader
ARGS = {
    'image_dir_or_fnames': test_image_paths,  # Can be a list of file paths
    'image_size': 224,
    'batch_size': 2,
    'num_workers': 0,  # Set to 0 for testing to avoid multiprocessing issues
    'num_samples': -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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_distance Ran
ran on a synthesized input
manicman1999/precision-recall-keras/precision-recall.py
code served (permissive licence) · get_code("8985988572ef4703")
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 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

v1 = np.array([1.0, 2.0, 3.0, 4.0])
v2 = np.array([5.0, 6.0, 7.0, 8.0])

ARGS = {
    "v1": v1,
    "v2": v2,
}
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 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
get_features Ran
ran, honoured the contract we drafted
thomaskerdreux/pdm_sar_insar_generation/utils/utils_precision_and_recall.py
code served (permissive licence) · get_code("6c9ddbe660f0c2da")
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 (4, 8) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(3, 8)  # Expects 3 channels (after repeat_interleave for 1-channel)
    
    def forward(self, x):
        # x shape: (batch, 3, height, width)
        # Return shape: (batch, 8) or (batch, 8, spatial_dims)
        batch_size = x.shape[0]
        # Flatten spatial dimensions and pass through fc
        x_flat = x.view(batch_size, 3, -1)  # (batch, 3, spatial_flat)
        x_flat = x_flat.mean(dim=2)  # (batch, 3)
        return self.fc(x_flat)  # (batch, 8)

model = MinimalClassifier()

# Create a minimal dataloader
# Each item is (image_tensor, label)
batch_size = 2
num_channels = 1
image_height = 4
image_width = 4

dataset = [
    (torch.randn(num_channels, image_height, image_width), 0)
    for _ in range(6)
]

dataloader = torch.utils.data.DataLoader(
    dataset,
    batch_size=batch_size,
    shuffle=False
)

ARGS = {
    "dataloader": dataloader,
    "num_channels": 1,
    "num_samples": 4,
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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 (4, 8) — shape (4, 8) 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
get_kth_value Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("bcc716018b80b027")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

get_kwarg Ran
ran, violated the contract we drafted
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("e0cea3ed105c7a3d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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.

get_rand Ran
ran; our contract draft was wrong, not the code
manicman1999/precision-recall-keras/precision-recall.py
code served (permissive licence) · get_code("739a22fef98ba093")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (5, 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 numpy as np

# Create a numpy array with shape (10, 3) - 10 samples, 3 features each
array = np.random.randn(10, 3)

# Amount of samples to randomly select
amount = 5

ARGS = {
    'array': array,
    'amount': amount
}
Setup block drafted by
a language model, Claude Sonnet 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 2, dtype family float, shape (5, 3) — shape (5, 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
import_images Ran
ran on a synthesized input
manicman1999/precision-recall-keras/precision-recall.py
code served (permissive licence) · get_code("934af065bd096a31")
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 ndarray, ndim 4, dtype family float, shape (4, 3, 4, 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 os
import tempfile
from PIL import Image
import numpy as np

# Create a temporary directory with test images
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'test_location')
os.makedirs(data_dir, exist_ok=True)

# Create a few test images in the expected format
for i in range(1, 3):
    img = Image.new('RGB', (4, 3), color=(i*50, i*60, i*70))
    img.save(os.path.join(data_dir, f'im ({i}).png'))

# Change to temp directory so 'data/' path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'loc': 'test_location',
    'flip': True,
    'suffix': 'png'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family float, shape (4, 3, 4, 3) — shape (4, 3, 4, 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
knn_precision_recall_features Ran
ran; our contract draft was wrong, not the code
thomaskerdreux/pdm_sar_insar_generation/utils/utils_precision_and_recall.py
code served (permissive licence) · get_code("b24b104ab2fc127d")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np

torch.manual_seed(0)

# Create small reference features: shape (2, 4)
ref_features = torch.randn(2, 4, dtype=torch.float32)

# Create small eval features: shape (3, 4)
eval_features = torch.randn(3, 4, dtype=torch.float32)

# Define arguments dict
ARGS = {
    'ref_features': ref_features,
    'eval_features': eval_features,
    'nhood_sizes': [1],
    'row_batch_size': 10000,
    'col_batch_size': 50000,
}
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 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
precision_and_recall Ran
ran on a synthesized input · constructed an object; no result was computed
blandocs/improved-precision-and-recall-metric-pytorch/functions.py
pointer only (licence: NONE) · get_code("8514f2c85dc29786")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, blandocs/improved-precision-and-recall-metric-pytorch when it was checked. 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.

realism Ran
ran; our contract draft was wrong, not the code
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("07bb109dd6cac3c5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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.

DistanceBlock Not yet run
unverified (harvested, no recorded run)
kynkaat/improved-precision-and-recall-metric/precision_recall.py
pointer only (licence: NONE) · get_code("24bf8c4eb19aecea")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kynkaat/improved-precision-and-recall-metric when it was checked. 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. No invocation recorded.

ManifoldEstimator Not yet run
unverified (harvested, no recorded run)
thomaskerdreux/pdm_sar_insar_generation/utils/utils_precision_and_recall.py
code served (permissive licence) · get_code("d6d787dc36eccdbb")
How it ran

no invocation recorded.

Metric Not yet run
unverified (harvested, no recorded run)
marcojira/fld/fld/metrics/PrecisionRecall.py
pointer only (licence: NONE) · get_code("5636e68117082a03")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, marcojira/fld when it was checked. 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. No invocation recorded.

batch_pairwise_distances Not yet run
unverified (harvested, no recorded run)
kynkaat/improved-precision-and-recall-metric/precision_recall.py
pointer only (licence: NONE) · get_code("5339fe677f2a8aa3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kynkaat/improved-precision-and-recall-metric when it was checked. 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. No invocation recorded.

calculate_precision_recall_full Not yet run
unverified (harvested, no recorded run)
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("fd7ffba6bfa9140c")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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. No invocation recorded.

compute_metric Not yet run
unverified (harvested, no recorded run)
youngjung/improved-precision-and-recall-metric-pytorch/improved_precision_recall.py
code served (permissive licence) · get_code("9f1f8858820c945f")
How it ran

no invocation recorded.

compute_precision_and_recall Not yet run
unverified (harvested, no recorded run)
thomaskerdreux/pdm_sar_insar_generation/utils/utils_precision_and_recall.py
code served (permissive licence) · get_code("d4b397f131e3cb0d")
How it ran

no invocation recorded.

get_custom_loader Not yet run
unverified (harvested, no recorded run)
AlexVerine/PrecisionRecallGan/precision_recall_kyn_utils.py
pointer only (licence: NONE) · get_code("43a458427eb4927c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AlexVerine/PrecisionRecallGan when it was checked. 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. No invocation recorded.

knn_precision_recall_features Not yet run
unverified (harvested, no recorded run)
psanch21/imp_bigan/utils/precision_recall/precision_recall.py
code served (permissive licence) · get_code("b3cb1184b1155ae5")
How it ran

no invocation recorded.

knn_precision_recall_features Not yet run
unverified (harvested, no recorded run)
kynkaat/improved-precision-and-recall-metric/precision_recall.py
pointer only (licence: NONE) · get_code("cb6d8f1a0fd320be")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kynkaat/improved-precision-and-recall-metric when it was checked. 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. No invocation recorded.

prc_features_to_metric Not yet run
unverified (harvested, no recorded run)
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("034a66af56d59bf1")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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. No invocation recorded.

vprint Not yet run
unverified (harvested, no recorded run)
toshas/torch-fidelity/torch_fidelity/metric_prc.py
pointer only (licence: NOASSERTION) · get_code("e51e3d0dd80555f0")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, toshas/torch-fidelity (NOASSERTION). 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. No invocation recorded.

Also present in other papers' code

Of 42 samples lifted from this paper's linked repositories, 42 carry a function identity and 0 do not. Of the 42 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 38 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
compute_pairwise_distances
brick of this paper's assembly: helper
2 other papers
2 later
2304.07574 (2023-04)
Exploring Incompatible Knowledge Transfer in Few-shot Image Generation
2412.08480 (2024-12)
InvDiff: Invariant Guidance for Bias Mitigation in Diffusion Models
distances2radii
brick of this paper's assembly: helper
2 other papers
2 later
2304.07574 (2023-04)
Exploring Incompatible Knowledge Transfer in Few-shot Image Generation
2412.08480 (2024-12)
InvDiff: Invariant Guidance for Bias Mitigation in Diffusion Models
get_kth_value
brick of this paper's assembly: helper
2 other papers
2 later
2304.07574 (2023-04)
Exploring Incompatible Knowledge Transfer in Few-shot Image Generation
2412.08480 (2024-12)
InvDiff: Invariant Guidance for Bias Mitigation in Diffusion Models
get_rand 1 other paper
1 dated earlier
1903.07291 (2019-03)
Semantic Image Synthesis with Spatially-Adaptive Normalization

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 ability to automatically estimate the quality and coverage of the samples produced by a generative model is a vital requirement for driving algorithm research. We present an evaluation metric that can separately and reliably measure both of these aspects in image generation tasks by forming explicit, non-parametric representations of the manifolds of real and generated data. We demonstrate the effectiveness of our metric in StyleGAN and BigGAN by providing several illustrative examples where existing metrics yield uninformative or contradictory results. Furthermore, we analyze multiple design variants of StyleGAN to better understand the relationships between the model architecture, training methods, and the properties of the resulting sample distribution. In the process, we identify new variants that improve the state-of-the-art. We also perform the first principled analysis of truncation methods and identify an improved method. Finally, we extend our metric to estimate the perceptual quality of individual samples, and use this to study latent space interpolations.

For agents

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

get_harvested_code_for_paper("1904.06991")
get_code_for_paper("1904.06991")
have("1904.06991")

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

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

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

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

Connect an agent — have() is free.