SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.15157 · 2023

R-LPIPS: An Adversarially Robust Perceptual Similarity Metric

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 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, 2 violated it and 0 have no contract verdict; 10 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/2307.15157.json · badge: /api/ran/2307.15157.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
saraghazanfari/r-lpips canonical (classifier label)
classifier basis: census
12 ran · 2 no recorded run
FunctionStatusWhere it lives
elementwise_margin Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/advertorch/loss.py
code served (permissive licence) · get_code("98f56a2103d5a1ce")
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 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 torch

torch.manual_seed(0)

# The function expects:
# - logits: a tensor of shape (batch_size, num_classes) containing logit scores
# - label: a tensor of shape (batch_size,) containing class indices

batch_size = 2
num_classes = 4

logits = torch.randn(batch_size, num_classes)
label = torch.tensor([0, 2])

ARGS = {
    "logits": logits,
    "label": label
}
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 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
get_dataset Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/util/imagenet_dataset.py
code served (permissive licence) · get_code("3f70b5d0ae386e75")
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 os
import tempfile
import torch
import numpy as np
from PIL import Image
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.datasets import ImageFolder

# Create a temporary directory structure with dummy images
temp_dir = tempfile.mkdtemp()
val_dir = os.path.join(temp_dir, 'val')
os.makedirs(val_dir, exist_ok=True)

# Create dummy class directories
class_dir_1 = os.path.join(val_dir, 'class_0')
class_dir_2 = os.path.join(val_dir, 'class_1')
os.makedirs(class_dir_1, exist_ok=True)
os.makedirs(class_dir_2, exist_ok=True)

# Create small dummy images (4x3 RGB)
for i in range(2):
    img_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(class_dir_1, f'img_{i}.jpg'))
    img.save(os.path.join(class_dir_2, f'img_{i}.jpg'))

ARGS = {
    'batch_size': 2,
    'num_workers': 0,
    'data_path': temp_dir,
    'split': 'val',
    'shuffle': False,
    'drop_last': False,
    'pin_memory': True,
    'has_normalize': True
}
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 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
hsv_to_rgb Ran
ran, violated the contract we drafted
saraghazanfari/r-lpips/util/byol_augmentation.py
code served (permissive licence) · get_code("d4345f2b46b25d5b")
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 3, 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 jax.numpy as jnp
import numpy as np

# Create small HSV tensors with valid ranges (0-1)
h = jnp.array([[0.1, 0.3, 0.5, 0.7],
               [0.2, 0.4, 0.6, 0.8]], dtype=jnp.float32)

s = jnp.array([[0.2, 0.4, 0.6, 0.8],
               [0.1, 0.3, 0.5, 0.7]], dtype=jnp.float32)

v = jnp.array([[0.5, 0.6, 0.7, 0.8],
               [0.4, 0.5, 0.6, 0.7]], dtype=jnp.float32)

ARGS = {
    "h": h,
    "s": s,
    "v": v,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
logit_margin_loss Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/advertorch/loss.py
code served (permissive licence) · get_code("583362dae5655ad5")
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 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

torch.manual_seed(0)

# Construct arguments for logit_margin_loss
batch_size = 2
num_classes = 4

# input: logits tensor of shape (batch_size, num_classes)
input = torch.randn(batch_size, num_classes)

# target: label indices tensor of shape (batch_size,)
# values should be in range [0, num_classes)
target = torch.tensor([0, 2], dtype=torch.long)

# reduction: string parameter
reduction = 'elementwise_mean'

# offset: float parameter
offset = 0.0

ARGS = {
    'input': input,
    'target': target,
    'reduction': reduction,
    'offset': offset
}
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 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
rgb_to_hsv Ran
ran, violated the contract we drafted
saraghazanfari/r-lpips/util/byol_augmentation.py
code served (permissive licence) · get_code("2e1473bfe12e6376")
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 3, 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 jax.numpy as jnp

# Set up small test tensors for RGB color components
# Each should be in range [0, 1] for proper HSV conversion
# Using distinct shapes to make dimensions clear

r = jnp.array([[0.2, 0.5, 0.8, 1.0],
                [0.0, 0.3, 0.6, 0.9]])

g = jnp.array([[0.1, 0.4, 0.7, 0.5],
                [0.2, 0.5, 0.8, 0.4]])

b = jnp.array([[0.3, 0.6, 0.9, 0.2],
                [0.4, 0.7, 1.0, 0.1]])

ARGS = {
    "r": r,
    "g": g,
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
score_2afc_dataset Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/lpips/trainer.py
code served (permissive licence) · get_code("913ca4bcb2170ff7")
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 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal trainer class that satisfies the function's needs
class MinimalTrainer:
    def __init__(self):
        self.train_mode = 'normal'
        self.var_ref = torch.randn(2, 3, 4, 5)
        self.var_p0 = torch.randn(2, 3, 4, 5)
        self.var_p1 = torch.randn(2, 3, 4, 5)
        self.input_judge = torch.tensor([0.3, 0.7])
        self.distance_fn = nn.MSELoss(reduction='none')
    
    def set_input(self, data):
        # Mock implementation - just stores the data
        pass
    
    def forward(self, var_a, var_b):
        # Return a distance tensor of shape (2, 1) which will be flattened
        diff = torch.mean((var_a - var_b) ** 2, dim=[1, 2, 3], keepdim=True)
        return diff
    
    def generate_attack_on_inputs(self):
        # Mock implementation for adversarial mode
        pass

# Create a minimal data loader that satisfies the function's needs
class MinimalDataLoader:
    def __init__(self, num_batches=2):
        self.num_batches = num_batches
    
    def load_data(self):
        # Yield mock data batches
        for i in range(self.num_batches):
            yield {'ref': torch.randn(2, 3, 4, 5), 
                   'p0': torch.randn(2, 3, 4, 5),
                   'p1': torch.randn(2, 3, 4, 5),
                   'judge': torch.tensor([0.4, 0.6])}

# Instantiate the objects
trainer = MinimalTrainer()
data_loader = MinimalDataLoader(num_batches=2)

# Define ARGS dictionary with all parameters
ARGS = {
    'data_loader': data_loader,
    'trainer': trainer,
    'name': 'test_2afc'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
score_jnd_dataset Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/lpips/trainer.py
code served (permissive licence) · get_code("990f761c0dedcc27")
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 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class MockDataLoader:
    def __init__(self):
        self.data = [
            {
                'p0': torch.randn(2, 3, 4, 5),
                'p1': torch.randn(2, 3, 4, 5),
                'same': torch.tensor([[1.0], [0.0]])
            },
            {
                'p0': torch.randn(2, 3, 4, 5),
                'p1': torch.randn(2, 3, 4, 5),
                'same': torch.tensor([[0.0], [1.0]])
            }
        ]
    
    def load_data(self):
        return self.data


class MockTrainer(nn.Module):
    def __init__(self):
        super().__init__()
        self.train_mode = 'normal'
        self.var_p0 = None
        self.var_p1 = None
        self.same = None
    
    def set_input(self, data):
        self.var_p0 = data['p0']
        self.var_p1 = data['p1']
        self.same = data['same']
    
    def generate_attack_on_inputs(self):
        pass
    
    def forward(self, p0, p1):
        # Return distance scores between batches
        batch_size = p0.shape[0]
        distances = torch.randn(batch_size, 1) * 0.5 + 0.5
        return distances


data_loader = MockDataLoader()
trainer = MockTrainer()

ARGS = {
    'data_loader': data_loader,
    'trainer': trainer,
    'name': 'test_jnd'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
lpips, numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
single_dim_flip Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
saraghazanfari/r-lpips/advertorch/utils.py
code served (permissive licence) · get_code("adf16a24fde1a1a2")
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 4, dtype family float, shape (2, 3, 4, 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)

# Create a small tensor with distinct dimensions (2, 3, 4, 5)
x = torch.randn(2, 3, 4, 5)

# Create a dim parameter to flip along dimension 1
dim = 1

ARGS = {
    "x": x,
    "dim": dim
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 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
spatial_average Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/lpips/lpips.py
code served (permissive licence) · get_code("29e5e72bcd006dcd")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 1, 1) 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)

# The function performs spatial averaging on a 4D tensor (batch, channels, height, width)
# by taking the mean over dimensions 2 and 3 (height and width)
in_tens = torch.randn(2, 4, 3, 5)  # batch=2, channels=4, height=3, width=5

ARGS = {
    "in_tens": in_tens,
    "keepdim": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
torch_allclose Ran
ran; our contract draft was wrong, not the code
saraghazanfari/r-lpips/advertorch/utils.py
code served (permissive licence) · get_code("d8da4c966b934936")
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 bool, 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 torch
import numpy as np

torch.manual_seed(0)

# Create two similar torch tensors with small shapes
x = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

y = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

rtol = 1e-05
atol = 1e-08

ARGS = {
    "x": x,
    "y": y,
    "rtol": rtol,
    "atol": atol
}
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 bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (read:FileNotFoundError)
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
torch_flip Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
saraghazanfari/r-lpips/advertorch/utils.py
code served (permissive licence) · get_code("dc96569e5f40c282")
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 4, dtype family float, shape (2, 3, 4, 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)

# Create a small tensor with distinct dimensions for probing
x = torch.randn(2, 3, 4, 5)

# dims parameter: list of dimensions to flip
dims = [0, 2]

ARGS = {
    "x": x,
    "dims": dims
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 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
upsample Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
saraghazanfari/r-lpips/lpips/lpips.py
code served (permissive licence) · get_code("8cafd18b57a4d171")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 64, 64) 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

torch.manual_seed(0)

# Create a small input tensor with shape (batch, channels, height, width)
# Using batch=2, channels=4, height=8, width=6 for distinct dimensions
in_tens = torch.randn(2, 4, 8, 6)

# Define output height and width
out_HW = (64, 64)

ARGS = {
    'in_tens': in_tens,
    'out_HW': out_HW
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 4, 64, 64) — shape (2, 4, 64, 64) 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
postprocess Not yet run
unverified (harvested, no recorded run)
saraghazanfari/r-lpips/util/byol_augmentation.py
code served (permissive licence) · get_code("14cab6547eefa04c")
How it ran

no invocation recorded.

zero_one_loss Not yet run
unverified (harvested, no recorded run)
saraghazanfari/r-lpips/advertorch/loss.py
code served (permissive licence) · get_code("15c400f6071b6c02")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 8 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 5 later) and 6 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
spatial_average 19 other papers
10 dated earlier, 8 later, 1 same year, order not determinable
1801.03924 (2018-01)
The Unreasonable Effectiveness of Deep Features as a Perceptual Metric
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2002.09219 (2020-02)
Stochastic Latent Residual Video Prediction
and 16 more not named here
upsample 5 other papers
2 dated earlier, 3 later
1801.03924 (2018-01)
The Unreasonable Effectiveness of Deep Features as a Perceptual Metric
2207.13686 (2022-07)
Shift-tolerant Perceptual Similarity Metric
2401.08573 (2024-01)
WAVES: Benchmarking the Robustness of Image Watermarks
and 2 more not named here
hsv_to_rgb 2 other papers
2 dated earlier
2201.05119 (2022-01)
Pushing the limits of self-supervised ResNets: Can we outperform supervised learning without labels on ImageNet?
2301.05158 (2023-01)
SemPPL: Predicting pseudo-labels for better contrastive representations
postprocess 2 other papers
2 dated earlier
2201.05119 (2022-01)
Pushing the limits of self-supervised ResNets: Can we outperform supervised learning without labels on ImageNet?
2301.05158 (2023-01)
SemPPL: Predicting pseudo-labels for better contrastive representations
rgb_to_hsv 2 other papers
2 dated earlier
2201.05119 (2022-01)
Pushing the limits of self-supervised ResNets: Can we outperform supervised learning without labels on ImageNet?
2301.05158 (2023-01)
SemPPL: Predicting pseudo-labels for better contrastive representations
single_dim_flip 1 other paper
1 later
2310.07931 (2023-10)
D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning
torch_allclose 1 other paper
1 later
2310.07931 (2023-10)
D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning
torch_flip 1 other paper
1 later
2310.07931 (2023-10)
D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning

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

Similarity metrics have played a significant role in computer vision to capture the underlying semantics of images. In recent years, advanced similarity metrics, such as the Learned Perceptual Image Patch Similarity (LPIPS), have emerged. These metrics leverage deep features extracted from trained neural networks and have demonstrated a remarkable ability to closely align with human perception when evaluating relative image similarity. However, it is now well-known that neural networks are susceptible to adversarial examples, i.e., small perturbations invisible to humans crafted to deliberately mislead the model. Consequently, the LPIPS metric is also sensitive to such adversarial examples. This susceptibility introduces significant security concerns, especially considering the widespread adoption of LPIPS in large-scale applications. In this paper, we propose the Robust Learned Perceptual Image Patch Similarity (R-LPIPS) metric, a new metric that leverages adversarially trained deep features. Through a comprehensive set of experiments, we demonstrate the superiority of R-LPIPS compared to the classical LPIPS metric. The code is available at https://github.com/SaraGhazanfari/R-LPIPS.

For agents

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

get_harvested_code_for_paper("2307.15157")
get_code_for_paper("2307.15157")
have("2307.15157")

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

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

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

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

Connect an agent — have() is free.