SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.02826 · 2019

Self-Paced Contextual Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 0 have no contract verdict; 5 failures of our instrument; 0 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/1910.02826.json · badge: /api/ran/1910.02826.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
psclklnk/self-paced-rl canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_rewards_and_successes Ran
ran; our contract draft was wrong, not the code
psclklnk/self-paced-rl/visualize_results.py
code served (permissive licence) · get_code("49d8ab9979aa2628")
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 numpy as np

class MockSpec:
    def __init__(self):
        self.n_samples = 5

class MockPolicy:
    def __init__(self, param):
        self.param = param

class MockEnv:
    def __init__(self):
        self.spec = MockSpec()
    
    def get_spec(self):
        return self.spec
    
    def sample_rewards(self, n_samples, policy):
        rewards = np.random.rand(n_samples)
        success = np.random.rand(n_samples)
        return None, None, rewards, success

env = MockEnv()

policies = [
    [MockPolicy(i) for i in range(100)],
    [MockPolicy(i) for i in range(100)],
]

ARGS = {
    'env': env,
    'policies': policies,
}
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
creps_iteration_function Ran
ran; our contract draft was wrong, not the code
psclklnk/self-paced-rl/run_experiment.py
code served (permissive licence) · get_code("5f6c6fc97c8489f7")
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 numpy as np
import copy


class MockSpec:
    def __init__(self):
        self.n_samples = 2
        self.eta = 0.5


class MockEnv:
    def sample_rewards(self, n_samples, policy):
        # Return contexts, thetas, rewards, successes
        contexts = np.random.randn(n_samples, 4)
        thetas = np.random.randn(n_samples, 3)
        rewards = np.random.randn(n_samples)
        successes = np.random.randint(0, 2, n_samples).astype(float)
        return contexts, thetas, rewards, successes


class MockBuffer:
    def __init__(self):
        self.contexts_list = []
        self.thetas_list = []
        self.rewards_list = []
        self.successes_list = []
    
    def insert(self, contexts, thetas, rewards, successes):
        self.contexts_list.append(contexts)
        self.thetas_list.append(thetas)
        self.rewards_list.append(rewards)
        self.successes_list.append(successes)
    
    def get(self):
        contexts = np.vstack(self.contexts_list) if self.contexts_list else np.array([]).reshape(0, 4)
        thetas = np.vstack(self.thetas_list) if self.thetas_list else np.array([]).reshape(0, 3)
        rewards = np.hstack(self.rewards_list) if self.rewards_list else np.array([])
        successes = np.hstack(self.successes_list) if self.successes_list else np.array([])
        return contexts, thetas, rewards, successes


class MockCREPS:
    def reweight_samples(self, contexts, rewards, eta):
        # Return weights for the samples
        n_samples = len(rewards)
        weights = np.ones(n_samples) / n_samples
        return weights


class MockPolicy:
    def refit(self, weights, contexts, thetas):
        # Accept weights and data for refitting
        pass


ARGS = {
    'env': MockEnv(),
    'spec': MockSpec(),
    'policies': [],
    'average_rewards': [],
    'average_successes': [],
    'creps': MockCREPS(),
    'policy': MockPolicy(),
    'buffer': MockBuffer(),
    'seed': 42,
    'iteration': 0,
}
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 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
preprocess_cmaes_data Ran
ran; our contract draft was wrong, not the code
psclklnk/self-paced-rl/visualize_results.py
code served (permissive licence) · get_code("7361177519cf4322")
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 numpy as np

# Construct valid arguments for preprocess_cmaes_data
# The function expects d_cmaes: a list of dicts, each with 'idx', 'rewards', 'successes' keys
# 'idx' should have some initial 0.0 values followed by non-zero values
# 'rewards' and 'successes' should be 1D arrays of numbers

# Create sample data with proper structure
n_samples = 200  # Length of data arrays (needs to be long enough for savgol_filter with window=51)
n_runs = 3  # Number of CMA-ES runs

# Create idx array: starts with 0.0 values, then increases
idx_array = np.concatenate([np.zeros(10), np.arange(1, n_samples - 9)])

# Create rewards and successes arrays
rewards_array = np.sin(np.linspace(0, 4*np.pi, n_samples)) + np.random.normal(0, 0.1, n_samples)
successes_array = np.cos(np.linspace(0, 4*np.pi, n_samples)) + np.random.normal(0, 0.1, n_samples)

# Build d_cmaes as a list of dicts
d_cmaes = []
for i in range(n_runs):
    d_cmaes.append({
        'idx': idx_array.copy(),
        'rewards': rewards_array + np.random.normal(0, 0.05, n_samples),
        'successes': successes_array + np.random.normal(0, 0.05, n_samples)
    })

ARGS = {
    'd_cmaes': d_cmaes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
sagg_riac_iteration_function Ran
ran; our contract draft was wrong, not the code
psclklnk/self-paced-rl/run_experiment.py
code served (permissive licence) · get_code("6d7a6985f52aa736")
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 numpy as np
import copy

# Stand-in classes for the dependencies

class StandInSpec:
    def __init__(self):
        self.n_samples = 2
        self.eta = 0.5
    
    def value_features(self, contexts):
        # Return features for contexts, shape (n_contexts, n_features)
        return np.random.randn(contexts.shape[0], 3)

class StandInPolicy:
    def sample_action(self, context):
        # Return an action sampled given a context
        return np.random.randn(4)
    
    def refit(self, weights, contexts, actions):
        # Refit policy given weighted samples
        pass

class StandInEnvironment:
    def evaluate(self, contexts, thetas):
        # Evaluate contexts and actions, return rewards and successes
        n = contexts.shape[0]
        rewards = np.random.randn(n)
        successes = np.random.rand(n) > 0.5
        return rewards, successes

class StandInSampleReplay:
    def __init__(self):
        self.states = []
    
    def sample_states(self, n):
        # Sample n states from replay buffer
        if len(self.states) < n:
            return np.random.randn(n, 4)
        indices = np.random.choice(len(self.states), n, replace=False)
        return np.array([self.states[i] for i in indices])
    
    def add_states(self, states, rewards):
        # Add states to replay buffer
        self.states.extend(states)

class StandInBuffer:
    def __init__(self):
        self.contexts = []
        self.thetas = []
        self.rewards = []
        self.successes = []
    
    def insert(self, contexts, thetas, rewards, successes):
        # Insert batch into buffer
        self.contexts.extend(contexts)
        self.thetas.extend(thetas)
        self.rewards.extend(rewards)
        self.successes.extend(successes)
    
    def get(self):
        # Return all buffered data
        return (
            np.array(self.contexts) if self.contexts else np.zeros((0, 4)),
            np.array(self.thetas) if self.thetas else np.zeros((0, 4)),
            np.array(self.rewards) if self.rewards else np.zeros(0),
            np.array(self.successes) if self.successes else np.zeros(0)
        )

class StandInAlgorithm:
    def __init__(self):
        self._feature_mean = np.zeros(3)
    
    def reweight_samples(self, contexts, rewards, eta):
        # Reweight samples based on reward
        n = len(rewards)
        weights = np.ones(n)
        return weights

# Build ARGS
ARGS = {
    'env': StandInEnvironment(),
    'spec': StandInSpec(),
    'policies': [],
    'average_rewards': [],
    'average_successes': [],
    'alg': StandInAlgorithm(),
    'sr': StandInSampleReplay(),
    'policy': StandInPolicy(),
    'buffer': StandInBuffer(),
    'seed': 42,
    'iteration': 0
}
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 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
sprl_iteration_function Ran
ran; our contract draft was wrong, not the code
psclklnk/self-paced-rl/run_experiment.py
code served (permissive licence) · get_code("ca797971c8008ff7")
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 numpy as np
import copy


class MockDistribution:
    """Mock distribution with get_log_pdf method and sigma attribute"""
    def __init__(self, dim=4):
        self.dim = dim
        self.sigma = np.eye(dim)
    
    def get_log_pdf(self, contexts):
        # Return log pdf values for each context
        return np.zeros(len(contexts))


class MockPolicy:
    """Mock policy"""
    def __call__(self, context):
        return np.random.randn(4)


class MockDistributionWrapper:
    """Wrapper for distribution with policy and distribution"""
    def __init__(self):
        self.policy = MockPolicy()
        self.distribution = MockDistribution(dim=4)
    
    def refit(self, weights, contexts, thetas, x_weights=None):
        """Refit the distribution"""
        pass


class MockTargetDist:
    """Mock target distribution"""
    def get_log_pdf(self, contexts):
        return np.zeros(len(contexts))


class MockAlphaSchedule:
    """Mock alpha schedule"""
    def get_value(self, iteration, avg_rew, kl_div):
        return 0.5


class MockSpec:
    """Mock specification object"""
    def __init__(self):
        self.n_samples = 6
        self.target_dist = MockTargetDist()
        self.alpha_schedule = MockAlphaSchedule()
        self.kl_div_thresh = 1.0
        self.lower_variance_bound = 0.01
        self.eta = 0.1


class MockBuffer:
    """Mock replay buffer"""
    def __init__(self):
        self.contexts = None
        self.thetas = None
        self.rewards = None
        self.successes = None
    
    def insert(self, contexts, thetas, rewards, successes):
        self.contexts = contexts
        self.thetas = thetas
        self.rewards = rewards
        self.successes = successes
    
    def get(self):
        return self.contexts, self.thetas, self.rewards, self.successes


class MockEnv:
    """Mock environment"""
    def sample_rewards(self, n_samples, policy, distribution):
        contexts = np.random.randn(n_samples, 4)
        thetas = np.random.randn(n_samples, 3)
        rewards = np.random.randn(n_samples)
        successes = np.random.randint(0, 2, n_samples).astype(float)
        return contexts, thetas, rewards, successes


class MockAlgorithm:
    """Mock algorithm with reweight_samples method"""
    def reweight_samples(self, contexts, get_log_pdf_fn, rewards, eta, alpha):
        n_samples = len(contexts)
        weights = np.ones(n_samples) / n_samples
        context_weights = np.ones(n_samples) / n_samples
        return weights, context_weights


ARGS = {
    'env': MockEnv(),
    'spec': MockSpec(),
    'policies': [],
    'average_rewards': [],
    'average_successes': [],
    'alg': MockAlgorithm(),
    'distribution': MockDistributionWrapper(),
    'buffer': MockBuffer(),
    'seed': 42,
    'iteration': 0,
}
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 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 2 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
creps_iteration_function 1 other paper
1 later
2102.13176 (2021-02)
A Probabilistic Interpretation of Self-Paced Learning with Applications to Reinforcement Learning
sagg_riac_iteration_function 1 other paper
1 later
2102.13176 (2021-02)
A Probabilistic Interpretation of Self-Paced Learning with Applications to Reinforcement Learning
sprl_iteration_function 1 other paper
1 later
2102.13176 (2021-02)
A Probabilistic Interpretation of Self-Paced Learning with Applications to Reinforcement Learning

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

Generalization and adaptation of learned skills to novel situations is a core requirement for intelligent autonomous robots. Although contextual reinforcement learning provides a principled framework for learning and generalization of behaviors across related tasks, it generally relies on uninformed sampling of environments from an unknown, uncontrolled context distribution, thus missing the benefits of structured, sequential learning. We introduce a novel relative entropy reinforcement learning algorithm that gives the agent the freedom to control the intermediate task distribution, allowing for its gradual progression towards the target context distribution. Empirical evaluation shows that the proposed curriculum learning scheme drastically improves sample efficiency and enables learning in scenarios with both broad and sharp target context distributions in which classical approaches perform sub-optimally.

For agents

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

get_harvested_code_for_paper("1910.02826")
get_code_for_paper("1910.02826")
have("1910.02826")

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

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

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

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

Connect an agent — have() is free.