Loading…
Glossary term
In reinforcement learning, the signal that defines what counts as good behavior.
The reward function tells a reinforcement learning agent how well it is doing at each step: for example +1 for reaching the goal and -0.01 for each step taken. The agent learns to maximize the total.
Designing it well is crucial, since agents exploit loopholes in badly specified rewards.
A simple reward function
def reward(reached_goal, steps_taken):
return (10 if reached_goal else 0) - 0.01 * steps_takenIt defines the goal. If the reward does not match what you really want, the agent will pursue the wrong thing.