Deep Q-Learning (DQN)
Why DQN?
In an environment with a continuous state space it is impossible to visit every state-action pair repeatedly: there are infinitely many of them, and the Q-table would be unmanageably large.
DQN sidesteps this by approximating the Q-function with a neural network and learning from previously stored experiences. The agent can therefore learn repeatedly from episodes it has already lived without having to live them again, which also avoids the cost of computing and updating a Q-table over a continuous state space.
Components
- Main neural network — predicts the expected return of taking each action in a given state. Trained and updated every episode.
- Replay buffer — a list filled with the experiences the agent has lived. An experience records the current state, the action taken in it, the reward obtained, whether it is a terminal state, and the next state reached.
- State size
- Action size
- Gamma — the discount factor
- Episode
- Number of steps
- Epsilon value and epsilon decay
- Learning rate
- Target-network update rate
Source code
References