SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.14565 · 2021

DreamerPro: Reconstruction-Free Model-Based Reinforcement Learning with Prototypical Representations

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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures 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/2110.14565.json · badge: /api/ran/2110.14565.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
fdeng18/dreamer-pro canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
get_url Ran
ran on a synthesized input
fdeng18/dreamer-pro/download_videos.py
code served (permissive licence) · get_code("7cfa9dd88da0b290")
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 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 json
import tempfile
import os

# Create a temporary JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.json")

test_data = {
    "item1": {
        "url": "https://example.com/car1.jpg",
        "annotations": {
            "label": "driving car"
        }
    },
    "item2": {
        "url": "https://example.com/person.jpg",
        "annotations": {
            "label": "person"
        }
    },
    "item3": {
        "url": "https://example.com/car2.jpg",
        "annotations": {
            "label": "driving car"
        }
    },
    "item4": {
        "url": "https://example.com/truck.jpg",
        "annotations": {
            "label": "truck"
        }
    }
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "path": temp_file
}
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 list, ndim 1, 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
lambda_return Ran
ran on a synthesized input
fdeng18/dreamer-pro/Dreamer/common/other.py
code served (permissive licence) · get_code("8cd9b6c638b90ac8")
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 (3, 2, 4) 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 with distinct dimensions to probe shapes
batch_size = 2
time_steps = 3
feature_dim = 4

# reward: shape (time_steps, batch_size, feature_dim)
reward = tf.random.normal([time_steps, batch_size, feature_dim])

# value: same shape as reward
value = tf.random.normal([time_steps, batch_size, feature_dim])

# pcont: can be scalar or same shape as reward
pcont = 0.99

# bootstrap: shape matching value[-1], which is (batch_size, feature_dim)
bootstrap = tf.random.normal([batch_size, feature_dim])

# lambda_: scalar between 0 and 1
lambda_ = 0.95

# axis: which axis to transpose (0 in this case, but can be tested with other values)
axis = 0

ARGS = {
    "reward": reward,
    "value": value,
    "pcont": pcont,
    "bootstrap": bootstrap,
    "lambda_": lambda_,
    "axis": axis,
}
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 3, dtype family float, shape (3, 2, 4) — shape (3, 2, 4) 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_baselines Ran
ran on a synthesized input
fdeng18/dreamer-pro/Dreamer/common/plot.py
code served (permissive licence) · get_code("b3ae56f77b905c0e")
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 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 collections
import json
import pathlib
import re
import tempfile
from unittest.mock import patch

Run = collections.namedtuple('Run', 'task method seed xs ys')

# Create temporary directory and baseline files for testing
temp_dir = tempfile.TemporaryDirectory()
scores_dir = pathlib.Path(temp_dir.name) / 'scores'
scores_dir.mkdir(parents=True, exist_ok=True)

# Create a sample baselines JSON file
baseline_data = {
    'task1': {
        'baseline_method_a': 0.85,
        'baseline_method_b': 0.90,
        'other_method': 0.75
    },
    'task2': {
        'baseline_method_c': 0.88,
        'custom_method': 0.92
    }
}

baseline_file = scores_dir / 'test_baselines.json'
baseline_file.write_text(json.dumps(baseline_data))

# Create regex patterns to match baseline methods
patterns = [
    re.compile(r'baseline_method_a'),
    re.compile(r'baseline_method_c'),
]

ARGS = {
    'patterns': patterns,
    'prefix': False,
}
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 list, ndim 1, 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
load_episodes Ran
ran on a synthesized input
fdeng18/dreamer-pro/Dreamer/common/replay.py
code served (permissive licence) · get_code("2b83bd6ccce56fca")
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 dict. 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 pathlib
import numpy as np
import tempfile
import os

# Create a temporary directory with sample .npz files
temp_dir = tempfile.mkdtemp()

# Create sample episode data
episode_data_1 = {
    'reward': np.array([1.0, 2.0, 3.0, 4.0, 5.0]),
    'action': np.array([[0, 1], [1, 0], [0, 1], [1, 0], [0, 1]]),
    'observation': np.array([[[1, 2, 3, 4]], [[2, 3, 4, 5]], [[3, 4, 5, 6]], [[4, 5, 6, 7]], [[5, 6, 7, 8]]])
}

episode_data_2 = {
    'reward': np.array([0.5, 1.5, 2.5]),
    'action': np.array([[1, 1], [0, 0], [1, 0]]),
    'observation': np.array([[[10, 11, 12, 13]], [[11, 12, 13, 14]], [[12, 13, 14, 15]]])
}

# Save episodes as .npz files with names that will sort in reverse
npz_file_1 = os.path.join(temp_dir, 'episode_002.npz')
npz_file_2 = os.path.join(temp_dir, 'episode_001.npz')

np.savez(npz_file_1, **episode_data_1)
np.savez(npz_file_2, **episode_data_2)

ARGS = {
    'directory': temp_dir,
    'limit': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
save_episodes Ran
ran on a synthesized input
fdeng18/dreamer-pro/Dreamer/common/replay.py
code served (permissive licence) · get_code("44b72fcd9872fef3")
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 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 datetime
import io
import pathlib
import uuid
import numpy as np
import tempfile

# Create a temporary directory for saving episodes
temp_dir = tempfile.mkdtemp()

# Construct sample episodes
# Each episode is a dict with at least 'reward' key (which must be an array)
episodes = [
    {
        'reward': np.array([0.0, 1.0, 2.0, 3.0]),
        'observation': np.array([[1, 2, 3], [4, 5, 6]]),
        'action': np.array([0, 1])
    },
    {
        'reward': np.array([0.5, 1.5]),
        'observation': np.array([[7, 8, 9]]),
        'action': np.array([1])
    }
]

ARGS = {
    'directory': temp_dir,
    'episodes': episodes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
schedule Ran
ran on a synthesized input
fdeng18/dreamer-pro/Dreamer/common/other.py
code served (permissive licence) · get_code("c2659ae89b97624c")
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 float, 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

# Test case 1: Simple float string
string_1 = "0.001"
step_1 = tf.constant(100, dtype=tf.int32)

# Test case 2: Linear schedule
string_2 = "linear(0.1,0.01,1000)"
step_2 = tf.constant(500, dtype=tf.int32)

# Test case 3: Warmup schedule
string_3 = "warmup(100,0.1)"
step_3 = tf.constant(50, dtype=tf.int32)

# Test case 4: Exponential schedule
string_4 = "exp(0.1,0.001,500)"
step_4 = tf.constant(250, dtype=tf.int32)

# Test case 5: Horizon schedule
string_5 = "horizon(10,100,1000)"
step_5 = tf.constant(500, dtype=tf.int32)

ARGS = {
    "string": string_1,
    "step": step_1,
}
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 float, 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
static_scan Ran
ran on a synthesized input
fdeng18/dreamer-pro/Dreamer/common/other.py
code served (permissive licence) · get_code("77ff0f8ba58bad0e")
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 2, dtype family float, shape (2, 4) 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

# Define a simple function that takes (state, input) and returns new state
def simple_fn(state, inp):
    # state and inp are both single tensors
    # This function just adds them together and returns a new state
    return state + inp

# Create small test tensors
# inputs should have shape (sequence_length, feature_dim)
sequence_length = 2
feature_dim = 4
inputs = tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

# start is the initial state, should have same shape as individual outputs
start = tf.constant([0.0, 0.0, 0.0, 0.0], dtype=tf.float32)

ARGS = {
    "fn": simple_fn,
    "inputs": inputs,
    "start": start,
    "reverse": False,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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_run Not yet run
unverified (harvested, no recorded run)
fdeng18/dreamer-pro/Dreamer/common/plot.py
code served (permissive licence) · get_code("f90fbc5c43d007c0")
How it ran

no invocation recorded.

load_runs Not yet run
unverified (harvested, no recorded run)
fdeng18/dreamer-pro/Dreamer/common/plot.py
code served (permissive licence) · get_code("4878c13e37288f19")
How it ran

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, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 3 later) and 1 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
schedule 2 other papers
1 dated earlier, 1 later
2010.02193 (2020-10)
Mastering Atari with Discrete World Models
2306.09205 (2023-06)
Reward-Free Curricula for Training Robust World Models
static_scan 2 other papers
1 dated earlier, 1 later
2010.02193 (2020-10)
Mastering Atari with Discrete World Models
2306.09205 (2023-06)
Reward-Free Curricula for Training Robust World Models
get_url 1 other paper
1 dated earlier
2106.07156 (2021-06)
Temporal Predictive Coding For Model-Based Planning In Latent Space
lambda_return 1 other paper
1 later
2306.09205 (2023-06)
Reward-Free Curricula for Training Robust World Models
load_baselines 1 other paper
1 dated earlier
2010.02193 (2020-10)
Mastering Atari with Discrete World Models
load_run 1 other paper
1 dated earlier
2010.02193 (2020-10)
Mastering Atari with Discrete World Models
load_runs 1 other paper
1 dated earlier
2010.02193 (2020-10)
Mastering Atari with Discrete World Models
save_episodes 1 other paper
1 dated earlier
2010.02193 (2020-10)
Mastering Atari with Discrete World Models

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

Top-performing Model-Based Reinforcement Learning (MBRL) agents, such as Dreamer, learn the world model by reconstructing the image observations. Hence, they often fail to discard task-irrelevant details and struggle to handle visual distractions. To address this issue, previous work has proposed to contrastively learn the world model, but the performance tends to be inferior in the absence of distractions. In this paper, we seek to enhance robustness to distractions for MBRL agents. Specifically, we consider incorporating prototypical representations, which have yielded more accurate and robust results than contrastive approaches in computer vision. However, it remains elusive how prototypical representations can benefit temporal dynamics learning in MBRL, since they treat each image independently without capturing temporal structures. To this end, we propose to learn the prototypes from the recurrent states of the world model, thereby distilling temporal structures from past observations and actions into the prototypes. The resulting model, DreamerPro, successfully combines Dreamer with prototypes, making large performance gains on the DeepMind Control suite both in the standard setting and when there are complex background distractions. Code available at https://github.com/fdeng18/dreamer-pro .

For agents

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

get_harvested_code_for_paper("2110.14565")
get_code_for_paper("2110.14565")
have("2110.14565")

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

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

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

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

Connect an agent — have() is free.