SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1903.04411 · 2019

Learning to Paint With Model-based Deep Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 13 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; 3 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/1903.04411.json · badge: /api/ran/1903.04411.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
hzwer/ICCV2019-LearningToPaint canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
pschaldenbrand/ContentMaskedLoss canonical (classifier label)
classifier basis: census
1 ran · 4 no recorded run
FunctionStatusWhere it lives
cal_trans Ran
ran on a synthesized input
hzwer/ICCV2019-LearningToPaint/baseline_modelfree/DRL/ddpg.py
code served (permissive licence) · get_code("23eda8fca1ca7dfd")
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)

# Analyze function: cal_trans(s, t) does:
# - s.transpose(0, 3) - transposes dimensions 0 and 3, so s must be 4D tensor
# - multiplies result by t (element-wise), so t must be broadcastable
# - transposes result back (0, 3)
# Both s and t should be tensors

# Create s: 4D tensor with distinct dimensions for probing
s = torch.randn(2, 3, 4, 5)

# Create t: must be broadcastable with s.transpose(0, 3)
# s.transpose(0, 3) has shape (5, 3, 4, 2)
# t can be same shape or broadcastable to it
t = torch.randn(5, 3, 4, 2)

ARGS = {
    "s": s,
    "t": t,
}
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
cfg Ran
ran; our contract draft was wrong, not the code
hzwer/ICCV2019-LearningToPaint/baseline_modelfree/DRL/actor.py
code served (permissive licence) · get_code("3e805cc6355e47d6")
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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'depth': 18
}
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 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
cfg Ran
ran; our contract draft was wrong, not the code
hzwer/ICCV2019-LearningToPaint/baseline_modelfree/DRL/critic.py
code served (permissive licence) · get_code("824c6b3b443d148a")
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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'depth': 18
}
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 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
hzwer/ICCV2019-LearningToPaint/baseline_modelfree/DRL/actor.py
pointer only (licence: MIT); the stored copy get_code serves, from amerch/CIFAR100-Training, is pointer only (licence: NONE) · get_code("583f9780bdd00a45")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from amerch/CIFAR100-Training, 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.

conv3x3 Ran
ran on a synthesized input
hzwer/ICCV2019-LearningToPaint/baseline_modelfree/DRL/critic.py
code served (permissive licence) · get_code("33b1a9d94f4b985d")
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 Conv2d. 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 torch.nn.utils.weight_norm as weightNorm

torch.manual_seed(0)

def conv3x3(in_planes, out_planes, stride=1):
    return weightNorm(nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True))

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
decode Ran
ran on a synthesized input
hzwer/ICCV2019-LearningToPaint/predict.py
code served (permissive licence) · get_code("75be60121d55e4f0")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal Decoder model that takes 10-dim input and outputs width*width predictions
class MinimalDecoder(nn.Module):
    def __init__(self, width):
        super().__init__()
        self.linear = nn.Linear(10, width * width)
        self.width = width
    
    def forward(self, x):
        # x shape: (batch, 10)
        # output shape: (batch, width*width)
        return self.linear(x)

width = 4
batch_size = 2

# Create the decoder
Decoder = MinimalDecoder(width)

# Create x: needs to be reshaped to (-1, 10+3) = (-1, 13)
# So we need batch_size * 5 * 13 = 2 * 5 * 13 = 130 elements
x = torch.randn(batch_size * 5, 13)

# Create canvas: should be (batch_size, 3, width, width) based on the operations
canvas = torch.randn(batch_size, 3, width, width)

ARGS = {
    "x": x,
    "canvas": canvas,
    "Decoder": Decoder,
    "width": width
}
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 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
load_images_from_path Ran
ran on a synthesized input
pschaldenbrand/ContentMaskedLoss/fid.py
code served (permissive licence) · get_code("a442e7afd354a754")
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 ndarray, ndim 4, dtype family float, shape (2, 256, 256, 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 numpy as np
import os
import tempfile
import cv2

# Create a temporary directory with test images
temp_dir = tempfile.mkdtemp()

# Create a few dummy .jpg images
for i in range(2):
    # Create a simple RGB image (100x100x3)
    dummy_img = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
    img_path = os.path.join(temp_dir, f'test_image_{i}.jpg')
    cv2.imwrite(img_path, dummy_img)

ARGS = {
    'images_path': temp_dir,
    'width': 256
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family float, shape (2, 256, 256, 3) — shape (2, 256, 256, 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
calculate_fid Not yet run
unverified (harvested, no recorded run)
pschaldenbrand/ContentMaskedLoss/fid.py
code served (permissive licence) · get_code("c3ce44b77ba5ecb6")
How it ran

no invocation recorded.

calculate_fid_stats Not yet run
unverified (harvested, no recorded run)
pschaldenbrand/ContentMaskedLoss/fid.py
code served (permissive licence) · get_code("b013a38b7632fed9")
How it ran

no invocation recorded.

color_cluster Not yet run
unverified (harvested, no recorded run)
pschaldenbrand/ContentMaskedLoss/paint.py
code served (permissive licence) · get_code("b140ae839d810c71")
How it ran

no invocation recorded.

decode_multiple_renderers Not yet run
unverified (harvested, no recorded run)
pschaldenbrand/ContentMaskedLoss/DRL/ddpg.py
code served (permissive licence) · get_code("a1790a331c5a0e5d")
How it ran

no invocation recorded.

large2small Not yet run
unverified (harvested, no recorded run)
hzwer/ICCV2019-LearningToPaint/predict.py
code served (permissive licence) · get_code("ebf21bcce2ab8654")
How it ran

no invocation recorded.

small2large Not yet run
unverified (harvested, no recorded run)
hzwer/ICCV2019-LearningToPaint/predict.py
code served (permissive licence) · get_code("0b361edd2c426c74")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
conv3x3 686 other papers
93 dated earlier, 8 the same month, 585 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
cfg 4 other papers
4 later
2202.13711 (2022-02)
Evaluating the Adversarial Robustness of Adaptive Test-time Defenses
2204.10839 (2022-04)
How Sampling Impacts the Robustness of Stochastic Neural Networks
2210.14026 (2022-10)
SWIFT: Rapid Decentralized Federated Learning via Wait-Free Model Communication
and 1 more not named here

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 show how to teach machines to paint like human painters, who can use a small number of strokes to create fantastic paintings. By employing a neural renderer in model-based Deep Reinforcement Learning (DRL), our agents learn to determine the position and color of each stroke and make long-term plans to decompose texture-rich images into strokes. Experiments demonstrate that excellent visual effects can be achieved using hundreds of strokes. The training process does not require the experience of human painters or stroke tracking data. The code is available at https://github.com/hzwer/ICCV2019-LearningToPaint.

For agents

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

get_harvested_code_for_paper("1903.04411")
get_code_for_paper("1903.04411")
have("1903.04411")

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

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

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

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

Connect an agent — have() is free.