Q-learning is a way for an agent to learn which actions are promising in different situations. It is model-free: the agent does not need to know how the environment works in advance. Instead, it tries actions, receives rewards, observes what changes, and improves its estimates. section 10.6
Its Q-table works like a scorecard. Each row represents a state, each column an available action, and each cell a Q-value: an estimate of that action’s quality in that state. To use the table, the agent finds its current row and chooses the action with the highest score. section 10.6
Learning a route
Imagine an agent moving through a parking lot toward a goal. Its position is a state, and a move is an action. The table starts with guesses. As the agent tries moves and sees their rewards and resulting positions, it revises the scores. It sometimes tries a random move rather than following the current highest score, giving it a chance to learn from other actions. section 10.6
Figure 10.13 Life cycle of a Q-learning reinforcement learning algorithm
Follow the training cycle from choosing an action through observing its outcome and improving the Q-table. section 10.6
A simple implementation creates a table with one entry per state–action pair, runs repeated simulations, and chooses either the current highest-scoring action or a random one. Deep Q-learning changes where the estimates live: a neural network predicts Q-values instead of storing them in a table. section 10.6 section 10.10


