SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.07689 · 2021

Dual Contrastive Learning for Unsupervised Image-to-Image Translation

arXiv · PDF · Open in the Atlas

Code that ran

4 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 6 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.07689.json · badge: /api/ran/2104.07689.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
Deopoler/DCLGAN-Keras community (classifier label)
classifier basis not recorded on the link
4 ran · 6 no recorded run
FunctionStatusWhere it lives
Encoder Ran
ran on a synthesized input
Deopoler/DCLGAN-Keras/modules/networks.py
code served (permissive licence) · get_code("5d5451412586a03f")
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 Functional. 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
from tensorflow.keras.layers import Input, Dense, Lambda, Conv2D, Flatten, Reshape, Activation
from tensorflow.keras.models import Model

# Create a minimal generator model with multiple layers
def create_generator():
    inputs = Input(shape=(4,))
    x = Dense(8, activation='relu')(inputs)
    x = Dense(6, activation='relu')(x)
    x = Dense(5, activation='relu')(x)
    outputs = Dense(4, activation='linear')(x)
    generator = Model(inputs=inputs, outputs=outputs, name='generator')
    return generator

generator = create_generator()

nce_layers = [0, 2, 3]

fp16 = False

ARGS = {
    'generator': generator,
    'nce_layers': nce_layers,
    'fp16': fp16
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Functional — a Functional output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Functional 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
create_dataset Ran
ran on a synthesized input
Deopoler/DCLGAN-Keras/utils.py
code served (permissive licence) · get_code("4f77a9e3e132775c")
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 tensorflow as tf
import tempfile
import os
import numpy as np
from PIL import Image

# Create temporary directories with dummy PNG images
temp_dir = tempfile.mkdtemp()

train_a_folder = os.path.join(temp_dir, 'train_a')
train_b_folder = os.path.join(temp_dir, 'train_b')
test_a_folder = os.path.join(temp_dir, 'test_a')
test_b_folder = os.path.join(temp_dir, 'test_b')

for folder in [train_a_folder, train_b_folder, test_a_folder, test_b_folder]:
    os.makedirs(folder, exist_ok=True)

# Create small dummy PNG images (286x286 to accommodate the function's resize and crop)
def create_dummy_image(path, width=286, height=286):
    img_array = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
    img = Image.fromarray(img_array, 'RGB')
    img.save(path)

# Create 2 images in each folder
for i in range(2):
    create_dummy_image(os.path.join(train_a_folder, f'image_{i}.png'))
    create_dummy_image(os.path.join(train_b_folder, f'image_{i}.png'))
    create_dummy_image(os.path.join(test_a_folder, f'image_{i}.png'))
    create_dummy_image(os.path.join(test_b_folder, f'image_{i}.png'))

ARGS = {
    'train_a_folder': train_a_folder,
    'train_b_folder': train_b_folder,
    'test_a_folder': test_a_folder,
    'test_b_folder': test_b_folder,
    'batch_size': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, tensorflow — 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
create_dir Ran
ran on a synthesized input
Deopoler/DCLGAN-Keras/utils.py
code served (permissive licence) · get_code("ff8a46b5b4b20261")
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 str. 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

def create_dir(dir):
    """ Create the directory.
    """
    if not os.path.exists(dir):
        os.makedirs(dir)
        print(f'Directory {dir} created')
    else:
        print(f'Directory {dir} already exists')
    return dir

# Create a temporary directory path for testing
temp_base = tempfile.gettempdir()
test_dir = os.path.join(temp_base, "test_create_dir_12345")

ARGS = {
    "dir": test_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
load_image Ran
ran on a synthesized input
Deopoler/DCLGAN-Keras/utils.py
code served (permissive licence) · get_code("c29e9a0f14c25a2f")
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 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 tensorflow as tf
import tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary PNG image file for testing
temp_dir = tempfile.mkdtemp()
image_path = os.path.join(temp_dir, "test_image.png")

# Create a small test image (300x300x3 to ensure it's larger than 286x286)
test_image_array = np.random.randint(0, 256, (300, 300, 3), dtype=np.uint8)
test_image = Image.fromarray(test_image_array)
test_image.save(image_path)

ARGS = {
    "image_file": image_path,
    "data_augmentation": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 3, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:OperatorNotAllowedInGraphError)
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
Discriminator Not yet run
unverified (harvested, no recorded run)
Deopoler/DCLGAN-Keras/modules/networks.py
code served (permissive licence) · get_code("29723a1d716a52d8")
How it ran

no invocation recorded.

Generator Not yet run
unverified (harvested, no recorded run)
Deopoler/DCLGAN-Keras/modules/networks.py
code served (permissive licence) · get_code("ce20b860ac6c1fb9")
How it ran

no invocation recorded.

filter_2d Not yet run
unverified (harvested, no recorded run)
Deopoler/DCLGAN-Keras/modules/ops/upfirdn_2d.py
code served (permissive licence) · get_code("2b7516dd2ec5a0a7")
How it ran

no invocation recorded.

get_plugin Not yet run
unverified (harvested, no recorded run)
Deopoler/DCLGAN-Keras/modules/ops/custom_ops.py
code served (permissive licence) · get_code("ead4a48eefa54ab0")
How it ran

no invocation recorded.

upfirdn_2d Not yet run
unverified (harvested, no recorded run)
Deopoler/DCLGAN-Keras/modules/ops/upfirdn_2d.py
code served (permissive licence) · get_code("f0893af6a4c9b53b")
How it ran

no invocation recorded.

upsample_2d Not yet run
unverified (harvested, no recorded run)
Deopoler/DCLGAN-Keras/modules/ops/upfirdn_2d.py
code served (permissive licence) · get_code("570d341df62e8b14")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Unsupervised image-to-image translation tasks aim to find a mapping between a source domain X and a target domain Y from unpaired training data. Contrastive learning for Unpaired image-to-image Translation (CUT) yields state-of-the-art results in modeling unsupervised image-to-image translation by maximizing mutual information between input and output patches using only one encoder for both domains. In this paper, we propose a novel method based on contrastive learning and a dual learning setting (exploiting two encoders) to infer an efficient mapping between unpaired data. Additionally, while CUT suffers from mode collapse, a variant of our method efficiently addresses this issue. We further demonstrate the advantage of our approach through extensive ablation studies demonstrating superior performance comparing to recent approaches in multiple challenging image translation tasks. Lastly, we demonstrate that the gap between unsupervised methods and supervised methods can be efficiently closed.

For agents

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

get_harvested_code_for_paper("2104.07689")
get_code_for_paper("2104.07689")
have("2104.07689")

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

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

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

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

Connect an agent — have() is free.