SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1811.11214 · 2018

Understanding the impact of entropy on policy optimization

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 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 8 have no contract verdict; 0 failures of our instrument; 4 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/1811.11214.json · badge: /api/ran/1811.11214.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
zafarali/emdp canonical (classifier label)
classifier basis: census
8 ran · 4 no recorded run
FunctionStatusWhere it lives
calculate_P_pi Ran
ran on a synthesized input
zafarali/emdp/emdp/analytic.py
code served (permissive licence) · get_code("32ef182f2fcd5540")
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 2, dtype family float, shape (4, 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 numpy as np

# Define the arguments for calculate_P_pi
# P: transition matrix of size |S| x |A| x |S|
# pi: matrix of size |S| x |A| indicating the policy

num_states = 4
num_actions = 3

# Create P with shape (|S|, |A|, |S|) = (4, 3, 4)
# Each entry should be a valid probability (between 0 and 1)
P = np.random.rand(num_states, num_actions, num_states)
# Normalize so each P(s, a, :) is a probability distribution
P = P / P.sum(axis=2, keepdims=True)

# Create pi with shape (|S|, |A|) = (4, 3)
# Each entry should be a valid probability (between 0 and 1)
pi = np.random.rand(num_states, num_actions)
# Normalize so each pi(s, :) is a probability distribution
pi = pi / pi.sum(axis=1, keepdims=True)

ARGS = {
    "P": P,
    "pi": pi
}
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 ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 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
calculate_R_pi Ran
ran on a synthesized input
zafarali/emdp/emdp/analytic.py
code served (permissive licence) · get_code("559d8413fadef7dd")
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 1, dtype family float, shape (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 numpy as np

# Define R: reward matrix of size |S| x |A|
# S (states) = 4, A (actions) = 3
R = np.array([
    [1.0, 2.0, 3.0],
    [0.5, 1.5, 2.5],
    [2.0, 3.0, 4.0],
    [1.0, 1.0, 1.0]
], dtype=np.float32)

# Define pi: policy matrix of size |S| x |A|
# Each row should sum to 1 (probability distribution over actions for each state)
pi = np.array([
    [0.5, 0.3, 0.2],
    [0.2, 0.5, 0.3],
    [0.1, 0.4, 0.5],
    [0.33, 0.33, 0.34]
], dtype=np.float32)

ARGS = {
    "R": R,
    "pi": pi
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
calculate_successor_representation Ran
ran on a synthesized input
zafarali/emdp/emdp/analytic.py
code served (permissive licence) · get_code("f41502a1141f91f2")
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 2, dtype family float, shape (4, 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 numpy as np

# Create a transition matrix P_pi
# For a valid successor representation calculation, P_pi should be a square matrix
# representing state transition probabilities under a policy
# Shape: (n_states, n_states)
n_states = 4
P_pi = np.random.rand(n_states, n_states)
# Normalize rows to make it a valid stochastic matrix
P_pi = P_pi / P_pi.sum(axis=1, keepdims=True)

# Gamma is the discount factor, typically between 0 and 1
gamma = 0.9

ARGS = {
    "P_pi": P_pi,
    "gamma": gamma
}
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 ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 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
convert_int_rep_to_onehot Ran
ran on a synthesized input
zafarali/emdp/emdp/utils.py
code served (permissive licence) · get_code("2f8f1b708cae85bc")
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 1, dtype family float, shape (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 numpy as np

# The function converts an integer state index to a one-hot encoded vector
# Parameters:
# - state: an integer index
# - vector_size: the size of the output one-hot vector

ARGS = {
    "state": 2,
    "vector_size": 5
}
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 ndarray, ndim 1, dtype family float, shape (5,) — shape (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
convert_onehot_to_int Ran
ran on a synthesized input
zafarali/emdp/emdp/utils.py
code served (permissive licence) · get_code("ddce36d2bea19efc")
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 numpy as np

# The function convert_onehot_to_int takes a state parameter
# It converts it to a numpy array if it isn't one already
# Then calls argmax() on it and extracts the item
# So we need a one-hot encoded array (or list that can be converted to one)

# Create a simple one-hot encoded state
# A one-hot vector has all zeros except one position which is 1
one_hot_state = np.array([0, 0, 1, 0])

ARGS = {
    "state": one_hot_state
}
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 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
flatten_state Ran
ran on a synthesized input
zafarali/emdp/emdp/gridworld/helper_utilities.py
code served (permissive licence) · get_code("e9132735b7655272")
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 1, dtype family float, shape (25,) 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

# Construct arguments for flatten_state
state = np.array([1, 2])  # A 2D coordinate (x=1, y=2)
size = 5  # Grid width/height parameter
state_space = 25  # Total number of possible states (5*5 grid)

ARGS = {
    "state": state,
    "size": size,
    "state_space": state_space
}
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 ndarray, ndim 1, dtype family float, shape (25,) — shape (25,) 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_char_matrix Ran
ran on a synthesized input
zafarali/emdp/emdp/gridworld/txt_utilities.py
code served (permissive licence) · get_code("b9209dad7af5de07")
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. 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 io

# Create a file-like object with some test content
test_content = "hello\nworld\ntest\n"
raw_file = io.StringIO(test_content)

ARGS = {
    "raw_file": raw_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 — a list 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
unflatten_state Ran
ran on a synthesized input
zafarali/emdp/emdp/gridworld/helper_utilities.py
code served (permissive licence) · get_code("ab93ad2916c7e6f1")
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, ndim 1, dtype family int; 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - onehot: a 1D tensor that gets sliced [:-1] if has_absorbing_state is True,
#           then reshaped to (size, size), then argmax operations are performed
# - size: an integer used for reshaping
# - has_absorbing_state: a boolean

# Create a one-hot vector that can be reshaped to (4, 4)
# If has_absorbing_state is True, we need one extra element (absorbing state)
# Total elements needed: 4*4 = 16, plus 1 for absorbing state = 17

size = 4
# Create a one-hot vector with 17 elements (16 for 4x4 grid + 1 absorbing)
onehot = torch.zeros(17)
onehot[5] = 1.0  # Set one position to 1 for one-hot encoding

has_absorbing_state = True

ARGS = {
    "onehot": onehot,
    "size": size,
    "has_absorbing_state": has_absorbing_state,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple 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
build_simple_grid_world_with_terminal_states Not yet run
unverified (harvested, no recorded run)
zafarali/emdp/emdp/gridworld/builder_tools.py
code served (permissive licence) · get_code("c4fc08fa7a1529be")
How it ran

no invocation recorded.

build_simple_grid_world_without_terminal_states Not yet run
unverified (harvested, no recorded run)
zafarali/emdp/emdp/gridworld/builder_tools.py
code served (permissive licence) · get_code("85e5152834f002c2")
How it ran

no invocation recorded.

create_reward_matrix Not yet run
unverified (harvested, no recorded run)
zafarali/emdp/emdp/gridworld/builder_tools.py
code served (permissive licence) · get_code("35c28033518042ff")
How it ran

no invocation recorded.

get_state_after_executing_action Not yet run
unverified (harvested, no recorded run)
zafarali/emdp/emdp/gridworld/helper_utilities.py
code served (permissive licence) · get_code("1fa703dcffebf785")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Entropy regularization is commonly used to improve policy optimization in reinforcement learning. It is believed to help with \emph{exploration} by encouraging the selection of more stochastic policies. In this work, we analyze this claim using new visualizations of the optimization landscape based on randomly perturbing the loss function. We first show that even with access to the exact gradient, policy optimization is difficult due to the geometry of the objective function. Then, we qualitatively show that in some environments, a policy with higher entropy can make the optimization landscape smoother, thereby connecting local optima and enabling the use of larger learning rates. This paper presents new tools for understanding the optimization landscape, shows that policy entropy serves as a regularizer, and highlights the challenge of designing general-purpose policy optimization algorithms.

For agents

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

get_harvested_code_for_paper("1811.11214")
get_code_for_paper("1811.11214")
have("1811.11214")

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

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

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

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

Connect an agent — have() is free.