What is Q-learning?
In Turkish: Q-öğrenme · Topic: Math foundations
A classic reinforcement learning algorithm that lets an agent learn by trial and error how much long-term reward each action will bring in each situation.
How does it work?
The algorithm keeps a Q value for every state and action pair, which is an estimate of the total reward that action can expect to bring. At the start the values are zero or random. Each time the agent takes an action and sees the reward and the new state, it nudges the relevant value toward the reward it received plus the best value it expects from the new state. After many repetitions the values approach the true ones, and the agent picks the action with the highest Q value in each state. It does not need to know the rules of the environment in advance.
Why does it matter?
Q-learning is one of the most basic and most widely taught reinforcement learning algorithms. Deep Q-networks (DQN), which estimate Q values with a neural network instead of a table, became well known through DeepMind's system that played Atari games. Understanding how it works also makes more complex agents easier to grasp.
Example
In a simple maze game, the agent gradually learns in a Q table which direction from each square gets it to the exit faster.
FAQ
What does the Q in Q-learning stand for?
It is commonly explained as short for quality. The Q value shows how good it is to take a particular action in a particular state.
Why can't Q-learning use a table on large problems?
When the number of states and actions becomes huge, storing the table and trying every cell enough times becomes impossible. That is why deep neural networks that approximate the Q values are used instead.