SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.00854 · CVPR · 2021

The Spatially-Correlative Loss for Various Image Translation Tasks

Jianfei Cai, Chuanxia Zheng, Tat-Jen Cham

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 4 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.00854.json · badge: /api/ran/2104.00854.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
lyndonzheng/F-LSeSim marked official in Papers with Code
Papers with Code archive
2 ran · 2 no recorded run
kaminyou/urust community
Papers with Code archive
2 ran · 2 no recorded run
FunctionStatusWhere it lives
PatchSim Ran
ran on a synthesized input · constructed an object; no result was computed
lyndonzheng/F-LSeSim/models/losses.py
code served (permissive licence) · get_code("abb74cdfb0db14b5")
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, PatchSim: 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal feature tensor
# Shape: (B, C, W, H) where B=2, C=4, W=8, H=6
feat = torch.randn(2, 4, 8, 6)

# Create patch_ids as optional parameter
patch_ids = torch.tensor([5, 12, 20], dtype=torch.long)

ARGS = {
    "patch_nums": 256,
    "patch_size": 3,
    "norm": True
}
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 PatchSim — 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 PatchSim 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
PatchSim Ran
ran on a synthesized input
kaminyou/urust/models/lsesim_loss.py
code served (permissive licence) · get_code("a2eb8b7b78c106d4")
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 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 torch
import numpy as np
from scipy import stats

INIT_ARGS = {
    "patch_nums": 4,
    "patch_size": 3,
    "norm": True
}

# Construct input tensor: batch=2, channels=4, width=6, height=5
feat = torch.randn(2, 4, 6, 5)

ARGS = {
    "feat": feat,
    "patch_ids": None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, scipy, torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
init_net Ran
ran; our contract draft was wrong, not the code
lyndonzheng/F-LSeSim/models/losses.py
code served (permissive licence) · get_code("c4df9e20fb740486")
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 SimpleNet. 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
from torch.nn import init

torch.manual_seed(0)

# Create a simple neural network with Conv2d, Linear, and BatchNorm2d layers
class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3)
        self.bn1 = nn.BatchNorm2d(16)
        self.linear1 = nn.Linear(16, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward(self, x):
        return x

net = SimpleNet()

ARGS = {
    'net': net,
    'init_type': 'normal',
    'init_gain': 0.02,
    'gpu_ids': [],
    'debug': False,
    'initialize_weights': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleNet — a SimpleNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleNet 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
init_net Ran
ran; our contract draft was wrong, not the code
kaminyou/urust/models/lsesim_loss.py
code served (permissive licence) · get_code("eb1d6ffba8881897")
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 SimpleNet. 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
import torch.nn as nn
from torch.nn import init

torch.manual_seed(0)

# Create a simple network with Conv2d, Linear, and BatchNorm2d layers
class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1)
        self.bn1 = nn.BatchNorm2d(16)
        self.linear1 = nn.Linear(16, 8)
        self.conv2 = nn.Conv2d(16, 32, kernel_size=3, padding=1)
    
    def forward(self, x):
        return x

# Instantiate the network
net = SimpleNet()

# Define ARGS dictionary with all parameters of init_net
ARGS = {
    'net': net,
    'init_type': 'xavier',
    'init_gain': 0.02,
    'debug': False,
    'initialize_weights': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleNet — a SimpleNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleNet 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
SpatialCorrelativeLoss Not yet run
unverified (harvested, no recorded run)
lyndonzheng/F-LSeSim/models/losses.py
code served (permissive licence) · get_code("314692ffde795932")
How it ran

no invocation recorded.

SpatialCorrelativeLoss Not yet run
unverified (harvested, no recorded run)
kaminyou/urust/models/lsesim_loss.py
code served (permissive licence) · get_code("215175861ccc5c15")
How it ran

no invocation recorded.

init_weights Not yet run
unverified (harvested, no recorded run)
lyndonzheng/F-LSeSim/models/losses.py
code served (permissive licence) · get_code("e68358ff8e30869e")
How it ran

no invocation recorded.

init_weights Not yet run
unverified (harvested, no recorded run)
kaminyou/urust/models/lsesim_loss.py
code served (permissive licence) · get_code("52cbc66ae3c1a146")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
init_net
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2112.09343 (2021-12)
Domain Adaptation on Point Clouds via Geometry-Aware Implicits
2204.13656 (2022-04)
Unsupervised Multi-Modal Medical Image Registration via Discriminator-Free Image-to-Image Translation
2602.04307 (2026-02)
Universal Robust Speech Adaptation for Cross-Domain Speech Recognition and Enhancement
init_net
brick of this paper's assembly: helper
1 other paper
1 later
2403.05093 (2024-03)
Spectrum Translation for Refinement of Image Generation (STIG) Based on Contrastive Learning and Spectral Filter Profile

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

We propose a novel spatially-correlative loss that is simple, efficient and yet effective for preserving scene structure consistency while supporting large appearance changes during unpaired image-to-image (I2I) translation. Previous methods attempt this by using pixel-level cycle-consistency or feature-level matching losses, but the domain-specific nature of these losses hinder translation across large domain gaps. To address this, we exploit the spatial patterns of self-similarity as a means of defining scene structure. Our spatially-correlative loss is geared towards only capturing spatial relationships within an image rather than domain appearance. We also introduce a new self-supervised learning method to explicitly learn spatially-correlative maps for each specific translation task. We show distinct improvement over baseline models in all three modes of unpaired I2I translation: single-modal, multi-modal, and even single-image translation. This new loss can easily be integrated into existing network architectures and thus allows wide applicability. The code is available at

For agents

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

get_harvested_code_for_paper("2104.00854")
get_code_for_paper("2104.00854")
have("2104.00854")

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

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

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

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

Connect an agent — have() is free.