liveBook · Manning

Reward signal

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

A reward is a numerical feedback signal returned by a reinforcement-learning environment after an agent takes an action.

A reward signal is numerical feedback returned by an environment after an agent acts in an observed state. Reinforcement learning uses accumulated rewards to treat actions that usually yield higher values in a state as more valuable. Early exploration can be random: the agent probes actions and action sequences, then retains behavior associated with better rewards. section 11.1

The signal is supplied by the environment, not invented separately by the agent. A training step produces a new state, reward, and completion flag; the learner uses the reward to revise its estimate of the action's value. This makes reward the immediate feedback that connects an action to later choices. section 11.1.1

Frozen lake: success and failure feedback

In a 4-by-4 frozen-lake task, an agent moves up, down, left, or right. Reaching the bottom-right goal ends the journey with a reward. Falling into a hole also ends it, but returns a negative reward. During each episode, rewards are added into a total score while the Q-table is updated from each transition. section 11.1.1

Figure 11.2 Frozen lake environment

Use the frozen-lake grid to inspect why terminal outcomes can return different reward values: a goal rewards progress, while a hole penalizes failure. section 11.1.1

Rewards can also evaluate candidates without directly training them. In a NEAT simulation, a genome's fitness is the sum of rewards collected across a run. Evolution then selects the genome with the strongest accumulated fitness; the agent itself does not learn to consume rewards through a Q-table update. section 11.3

Reward-driven approaches here differ in how they use the same environment feedback:

  • Q-learning updates a state-action lookup table from each observed reward and future state value. section 11.1.1
  • NEAT sums rewards into genome fitness and evolves higher-scoring candidates. section 11.3
  • Deep Q-learning replaces the Q-table or policy with deep learning for more complex environments. section 11.6

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains reward through state-action loops, a Q-learning update, and accumulated-fitness evaluation, while deferring deep Q-learning.
Examples
Uses FrozenLake goals and holes, Q-table training episodes, and Cart Pole genome simulations.
What it assumes
Introduces rewards from a pet-training analogy before using states, actions, episodes, and Q-tables.
What you can do after
Apply it via OpenAI Gym to train a Q-learning agent or score NEAT genomes from environment feedback.
How it connects
Connects reinforcement learning with agents, environment states, actions, Q-learning, Q-tables, fitness, NEAT, and Deep Q-learning.

Also explained in

Compare how 11 books explain reward signal →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.