SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.07379 · ICCV · 2021

DRB-GAN: A Dynamic ResBlock Generative Adversarial Network for Artistic Style Transfer

Wenju Xu, Guanghui Wang, Chengjiang Long, Ruisheng Wang

arXiv · PDF · Open in the Atlas

Code that ran

8 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 7 have no contract verdict; 1 failure of our instrument; 2 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/2108.07379.json · badge: /api/ran/2108.07379.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
sonnguyen129/deep-feature-rotation community (classifier label)
classifier basis not recorded on the link
8 ran · 2 no recorded run
FunctionStatusWhere it lives
calc_content_loss Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/loss.py
code served (permissive licence) · get_code("d0f714d6a89e9377")
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 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 tensorflow as tf

# Create small content outputs dictionary
# The function expects outputs['content'] to be a dict of tensors
content_outputs = {
    'layer1': tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32),
    'layer2': tf.constant([[2.0, 3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0]], dtype=tf.float32),
}

# Create small content targets dictionary with same keys and compatible shapes
content_targets = {
    'layer1': tf.constant([[1.1, 2.1, 3.1, 4.1], [5.1, 6.1, 7.1, 8.1]], dtype=tf.float32),
    'layer2': tf.constant([[2.1, 3.1, 4.1, 5.1], [6.1, 7.1, 8.1, 9.1]], dtype=tf.float32),
}

# Create outputs dict containing the content_outputs
outputs = {
    'content': content_outputs
}

# Simple scalars for weights and layer count
content_weight = 1.0
num_content_layers = 2

ARGS = {
    'outputs': outputs,
    'content_targets': content_targets,
    'content_weight': content_weight,
    'num_content_layers': num_content_layers,
}
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 EagerTensor, 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
calc_style_loss Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/loss.py
code served (permissive licence) · get_code("4ce9a5e63a0de9b1")
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 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 tensorflow as tf
import numpy as np

# Create mock style outputs dictionary with layer names as keys
style_outputs = {
    'layer_1': tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32),
    'layer_2': tf.constant([[2.0, 3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0]], dtype=tf.float32),
}

# Create mock style targets dictionary with same keys
style_targets = {
    'layer_1': tf.constant([[1.1, 2.1, 3.1, 4.1], [5.1, 6.1, 7.1, 8.1]], dtype=tf.float32),
    'layer_2': tf.constant([[2.1, 3.1, 4.1, 5.1], [6.1, 7.1, 8.1, 9.1]], dtype=tf.float32),
}

# Create outputs dictionary containing style outputs
outputs = {
    'style': style_outputs
}

# Set parameters
style_weight = 0.5
num_style_layers = 2

ARGS = {
    'outputs': outputs,
    'style_targets': style_targets,
    'style_weight': style_weight,
    'num_style_layers': num_style_layers,
}
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 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
extensive_rotation_tensor Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/rotation.py
code served (permissive licence) · get_code("e26a2b48ca392b96")
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 list, ndim 4, 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 numpy as np
from scipy.ndimage import rotate
import copy

# Create a small batch of 3D tensors (batch_size=2, height=4, width=3, channels=2)
# The function expects inputs to be iterable and each element should have .numpy() method
tensor1 = tf.random.normal((4, 3, 2))
tensor2 = tf.random.normal((4, 3, 2))
inputs = [tensor1, tensor2]

angles = 15

ARGS = {
    "inputs": inputs,
    "angles": angles,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, dtype family float — a list 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
gram_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sonnguyen129/deep-feature-rotation/dfr/model.py
code served (permissive licence) · get_code("24caeadc560dd7b1")
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, shape (2, 5, 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 tensorflow as tf
import numpy as np

# Create a small input tensor for gram_matrix
# The function expects shape (batch, height, width, channels)
# Using distinct dimensions: batch=2, height=4, width=3, channels=5
batch_size = 2
height = 4
width = 3
channels = 5

input_tensor = tf.constant(
    np.random.randn(batch_size, height, width, channels).astype(np.float32)
)

ARGS = {
    "input_tensor": input_tensor
}
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 3, dtype family float, shape (2, 5, 5) — shape (2, 5, 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
load_img Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/utils.py
code served (permissive licence) · get_code("5001a455e1e77841")
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 4, dtype family float, shape (1, 422, 512, 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 tempfile
import os

# Create a temporary directory and a small test image file
temp_dir = tempfile.mkdtemp()
img_path = os.path.join(temp_dir, "test_image.png")

# Create a minimal valid PNG image (1x1 pixel, red)
import numpy as np
from PIL import Image

img_array = np.uint8(np.random.randint(0, 256, (10, 10, 3)))
pil_img = Image.fromarray(img_array)
pil_img.save(img_path)

ARGS = {
    "path_to_img": img_path
}
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 4, dtype family float, shape (1, 422, 512, 3) — shape (1, 422, 512, 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
rotation_tensor Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/rotation.py
code served (permissive licence) · get_code("ea5fcba7243221d1")
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 list, ndim 5, 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 numpy as np
import copy

# Create a list of small TensorFlow tensors with shape (2, 3, 4, 5)
# This matches the 4D tensor indexing used in the function (transpose with (3,2,1,0))
tensor1 = tf.constant(np.random.randn(2, 3, 4, 5).astype(np.float32))
tensor2 = tf.constant(np.random.randn(2, 3, 4, 5).astype(np.float32))

inputs = [tensor1, tensor2]

ARGS = {
    "inputs": inputs,
    "angles": 90
}
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 list, ndim 5, dtype family float — a list 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
style_content_loss Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/loss.py
code served (permissive licence) · get_code("3a49ae39c3f94eb0")
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 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 tensorflow as tf

# Set seed for reproducibility
tf.random.set_seed(0)

# Create small tensors for style and content outputs
# Using distinct dimensions: batch=2, feature_dim=4
style_output_1 = tf.random.normal([2, 4])
style_output_2 = tf.random.normal([2, 3])

content_output_1 = tf.random.normal([2, 5])
content_output_2 = tf.random.normal([2, 6])

# Create style targets (same keys and shapes as style outputs)
style_target_1 = tf.random.normal([2, 4])
style_target_2 = tf.random.normal([2, 3])

# Create content targets (same keys and shapes as content outputs)
content_target_1 = tf.random.normal([2, 5])
content_target_2 = tf.random.normal([2, 6])

# Build outputs dict with 'style' and 'content' keys
outputs = {
    'style': {
        'layer1': style_output_1,
        'layer2': style_output_2,
    },
    'content': {
        'layer1': content_output_1,
        'layer2': content_output_2,
    }
}

# Build style and content targets dicts
style_targets = {
    'layer1': style_target_1,
    'layer2': style_target_2,
}

content_targets = {
    'layer1': content_target_1,
    'layer2': content_target_2,
}

# Define arguments
ARGS = {
    'outputs': outputs,
    'style_targets': style_targets,
    'content_targets': content_targets,
    'content_weight': 1.0,
    'style_weight': 0.5,
    'num_content_layers': 2,
    'num_style_layers': 2,
}
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 EagerTensor, 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
tensor_to_image Ran
ran on a synthesized input
sonnguyen129/deep-feature-rotation/dfr/utils.py
code served (permissive licence) · get_code("de8207efc4e58ec8")
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 Image. 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 torch
import PIL.Image

torch.manual_seed(0)

# The function expects a tensor-like object that:
# 1. Can be multiplied by 255
# 2. Can be converted to numpy array with dtype=np.uint8
# 3. May have more than 3 dimensions (batch dimension), in which case batch size must be 1
# 4. When 3D or less, should be valid input to PIL.Image.fromarray (HxWxC format)

# Create a valid tensor: shape (1, 4, 3, 3) representing batch=1, channels=4, height=3, width=3
# Values in range [0, 1] so when multiplied by 255 gives valid uint8 range
tensor = torch.rand(1, 4, 3, 3, dtype=torch.float32)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 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
clip_0_1 Not yet run
unverified (harvested, no recorded run)
sonnguyen129/deep-feature-rotation/dfr/function.py
code served (permissive licence) · get_code("0529813bf1196cab")
How it ran

no invocation recorded.

vgg_layers Not yet run
unverified (harvested, no recorded run)
sonnguyen129/deep-feature-rotation/dfr/model.py
code served (permissive licence) · get_code("c9e8ae02d557b195")
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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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
gram_matrix 2 other papers
2 dated earlier
1508.06576 (2015-08)
A Neural Algorithm of Artistic Style
1905.00561 (2019-05)
Large-scale weakly-supervised pre-training for video action recognition
vgg_layers 2 other papers
2 dated earlier
1508.06576 (2015-08)
A Neural Algorithm of Artistic Style
1905.00561 (2019-05)
Large-scale weakly-supervised pre-training for video action recognition

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

The paper proposes a Dynamic ResBlock Generative Adversarial Network (DRB-GAN) for artistic style transfer. The style code is modeled as the shared parameters for Dynamic ResBlocks connecting both the style encoding network and the style transfer network. In the style encoding network, a style class-aware attention mechanism is used to attend the style feature representation for generating the style codes. In the style transfer network, multiple Dynamic ResBlocks are designed to integrate the style code and the extracted CNN semantic feature and then feed into the spatial window Layer-Instance Normalization (SW-LIN) decoder, which enables high-quality synthetic images with artistic style transfer. Moreover, the style collection conditional discriminator is designed to equip our DRB-GAN model with abilities for both arbitrary style transfer and collection style transfer during the training stage. No matter for arbitrary style transfer or collection style transfer, extensive experiments strongly demonstrate that our proposed DRB-GAN outperforms state-of-the-art methods and exhibits its superior performance in terms of visual quality and efficiency. Our source code is available at https://github.com/xuwenju123/DRB-GAN .

For agents

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

get_harvested_code_for_paper("2108.07379")
get_code_for_paper("2108.07379")
have("2108.07379")

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

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

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

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

Connect an agent — have() is free.