SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.09542 · 2022

Domain Enhanced Arbitrary Image Style Transfer via Contrastive Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 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/2205.09542.json · badge: /api/ran/2205.09542.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
zyxelsa/cast_pytorch canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
get_filter Ran
ran, honoured the contract we drafted
zyxelsa/cast_pytorch/models/networks.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from heyblackC/DFMIR, is pointer only (licence: NONE) · get_code("acc24402a2d089fa")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from heyblackC/DFMIR, and GitHub detected no licence in that repository 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_norm_layer Ran
ran; our contract draft was wrong, not the code
zyxelsa/cast_pytorch/models/networks.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from amandinebtto/batvision-dataset, is pointer only (licence: CC-BY-SA-4.0) · get_code("b27dffc0609fbec0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from amandinebtto/batvision-dataset, and CC-BY-SA-4.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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_pad_layer Ran
ran; our contract draft was wrong, not the code
zyxelsa/cast_pytorch/models/networks.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from linwei-chen/seg-aliasing, is pointer only (licence: NONE) · get_code("50aa4a59fe718c61")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from linwei-chen/seg-aliasing, and GitHub detected no licence in that repository 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_rank Ran
ran on a synthesized input
zyxelsa/cast_pytorch/models/torch_utils.py
code served (permissive licence) · get_code("2e77a87b7e25bf88")
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 int, ndim 0, dtype family int, 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)

# The function get_rank takes an optional 'group' parameter
# It calls torch.distributed.get_rank(group) which expects a ProcessGroup or None
# Since we're not in a distributed setting, it will catch the exception and return 0
# The group parameter can be None (the default) or a torch.distributed.ProcessGroup

ARGS = {
    "group": None
}
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 int, ndim 0, dtype family int, 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
get_world_size Ran
ran on a synthesized input
zyxelsa/cast_pytorch/models/torch_utils.py
code served (permissive licence) · get_code("3c04aca76b8bb904")
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 int, ndim 0, dtype family int, 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)

# The function get_world_size takes an optional group parameter
# When group is None (default), it tries to get the world size from torch.distributed
# If that fails (which it will in non-distributed setup), it returns 1
# The group parameter would be a torch.distributed ProcessGroup, but we can pass None
# since the function handles the exception case

ARGS = {
    "group": None
}
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 int, ndim 0, dtype family int, 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
init_net Ran
ran; our contract draft was wrong, not the code
zyxelsa/cast_pytorch/models/cast_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from amandinebtto/batvision-dataset, is pointer only (licence: CC-BY-SA-4.0) · get_code("bf329cef80ee24c5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from amandinebtto/batvision-dataset, and CC-BY-SA-4.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

make_layers Ran
ran on a synthesized input
zyxelsa/cast_pytorch/models/MSP.py
code served (permissive licence) · get_code("ff27a10d6de78d9b")
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 Sequential. 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

torch.manual_seed(0)

# The function make_layers expects:
# 1. cfg: a list/sequence of integers or 'M' strings
# 2. batch_norm: a boolean

cfg = [64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512]
batch_norm = True

ARGS = {
    'cfg': cfg,
    'batch_norm': batch_norm
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
concat_all_gather Not yet run
unverified (harvested, no recorded run)
zyxelsa/cast_pytorch/models/torch_utils.py
code served (permissive licence) · get_code("d4b54a0f9c04607a")
How it ran

no invocation recorded.

find_launcher_using_name Not yet run
unverified (harvested, no recorded run)
zyxelsa/cast_pytorch/experiments/__main__.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from ssongwang/mix-domaincontrastivelearning, is pointer only (licence: NONE) · get_code("0efffbfa7278dd55")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from ssongwang/mix-domaincontrastivelearning, and GitHub detected no licence in that repository 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.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 6 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 3 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
get_pad_layer 25 other papers
8 dated earlier, 17 later · 3 only as an assembly brick
2004.09484 (2020-04)
Bringing Old Photos Back to Life
2007.15651 (2020-07)
Contrastive Learning for Unpaired Image-to-Image Translation
2008.09604 (2020-08)
Delving Deeper into Anti-aliasing in ConvNets
and 22 more not named here
get_norm_layer 16 other papers
5 dated earlier, 11 later · 2 only as an assembly brick
1511.06434 (2015-11)
Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks
1909.08313 (2019-09)
Unsupervised Sketch-to-Photo Synthesis
2007.15651 (2020-07)
Contrastive Learning for Unpaired Image-to-Image Translation
and 13 more not named here
init_net 14 other papers
11 dated earlier, 3 later
1406.2661 (2014-06)
Generative Adversarial Networks
1511.06434 (2015-11)
Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
and 11 more not named here
get_filter 9 other papers
2 dated earlier, 7 later · 1 only as an assembly brick
2007.15651 (2020-07)
Contrastive Learning for Unpaired Image-to-Image Translation
2204.13656 (2022-04)
Unsupervised Multi-Modal Medical Image Registration via Discriminator-Free Image-to-Image Translation
and 6 more not named here
concat_all_gather 1 other paper
1 dated earlier
2203.15375 (2022-03)
A Style-aware Discriminator for Controllable Image Translation
find_launcher_using_name 1 other paper
1 later
2406.11799 (2024-06)
Mix-Domain Contrastive Learning for Unpaired H&E-to-IHC Stain Translation

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

In this work, we tackle the challenging problem of arbitrary image style transfer using a novel style feature representation learning method. A suitable style representation, as a key component in image stylization tasks, is essential to achieve satisfactory results. Existing deep neural network based approaches achieve reasonable results with the guidance from second-order statistics such as Gram matrix of content features. However, they do not leverage sufficient style information, which results in artifacts such as local distortions and style inconsistency. To address these issues, we propose to learn style representation directly from image features instead of their second-order statistics, by analyzing the similarities and differences between multiple styles and considering the style distribution. Specifically, we present Contrastive Arbitrary Style Transfer (CAST), which is a new style representation learning and style transfer method via contrastive learning. Our framework consists of three key components, i.e., a multi-layer style projector for style code encoding, a domain enhancement module for effective learning of style distribution, and a generative network for image style transfer. We conduct qualitative and quantitative evaluations comprehensively to demonstrate that our approach achieves significantly better results compared to those obtained via state-of-the-art methods. Code and models are available at https://github.com/zyxElsa/CAST_pytorch

For agents

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

get_harvested_code_for_paper("2205.09542")
get_code_for_paper("2205.09542")
have("2205.09542")

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

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

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

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

Connect an agent — have() is free.