liveBook · Manning

Target q-value

As explained in Grokking AI Algorithms, Second Edition

A target Q-value is the reinforcement-learning estimate formed from an immediate reward plus a discounted estimate of the best future action value.

A target Q-value estimates what an action should be worth: its immediate reward plus a discounted estimate of the best future action value. It gives a neural network a learning target instead of a fixed label. section 10.11

The calculation follows a simple sequence:

  • Take the reward received after the action. section 10.11
  • Find the largest predicted Q-value for the resulting state. section 10.11
  • Discount that future value, then add it to the immediate reward. section 10.11
  • Compare the target with the network’s prediction for the action taken; their squared difference becomes the loss. section 10.11

A move toward the east

Suppose an agent moves east, receives +1, and reaches a state whose predicted action values are North 1.2, South 0.5, East 2.0, and West 0.3. With a discount factor of 0.9, the target is 1 + 0.9 × 2.0 = 2.8. If the network predicted 2.2 for the original east action, the difference drives learning. section 10.11

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Works through target construction and squared-error loss, but does not develop deeper reinforcement-learning theory.
Examples
Uses an eastward move, four next-state action values, a +1 reward, and a 0.9 discount factor.
What it assumes
Assumes basic reinforcement-learning terms while explaining rewards, states, actions, and discounting through an example.
What you can do after
Apply it to construct a learning target and calculate the prediction error for an action.
How it connects
Connects Q-function approximation with discount factor, neural-network prediction, loss, and backpropagation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.