Define task and reward forms
Specify the environment, terminal conditions and candidate shaped reward functions to evaluate.
Design reward shaping. Compare policy performance.
Reward shaping modifies an agent's reward signal to speed learning or bias behaviour. Practical experiments require a clear environment, baseline policies, logging of return curves and checks for unintended incentives introduced by shaping.
Learning concept · Not a validated service
Reward shaping modifies an agent's reward signal to speed learning or bias behaviour. Practical experiments require a clear environment, baseline policies, logging of return curves and checks for unintended incentives introduced by shaping.
A proposed use: compare shaped and unshaped reward functions in a controlled simulator so researchers can quantify sample efficiency and failure modes. For safety-critical domains a human must remain in the loop; this starter does not provide deployment-ready safeguards.
Specify the environment, terminal conditions and candidate shaped reward functions to evaluate.
Implement simple baselines (random, greedy, bandit) and a learning agent for comparison.
Collect return curves across random seeds and compare sample efficiency and variance.
Analyse episodes where shaping causes perverse incentives or unstable learning and iterate.
The supplied starter simulates a 4-armed bandit using an epsilon-greedy policy. It samples binary rewards from fixed Bernoulli rates, updates incremental sample-mean estimates for each action, and prints action counts, estimated reward rates and the total reward.
for step in range(1, 2001):
if rng.random() < epsilon:
action = rng.integers(len(true_reward_rates))
else:
action = int(np.argmax(estimated_values))
reward = 1 if rng.random() < true_reward_rates[action] else 0
action_counts[action] += 1
total_reward += reward
estimated_values[action] += (reward - estimated_values[action]) / action_counts[action]The code is a multi-armed bandit simulation and does not implement reward shaping, an environment, episodes, a value or policy-gradient learner, or any shaped reward functions. It cannot evaluate shaped versus unshaped rewards in sequential decision problems as described by the project title.
A proposed extension: implement a simple Gymnasium environment (grid or navigation), provide unshaped and shaped reward variants, train comparable agents (e.g. PPO or DQN), and log per-episode returns and stability across seeds to quantify gains and side effects.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.