Implementing the Dueling DQN agent
A Dueling DQN agent explicitly estimates two quantities through a modified network architecture:
- State values, V(s)
- Advantage values, A(s, a)
The state value estimates the value of being in state s, and the advantage value represents the advantage of taking action a in state s. This key idea of explicitly and separately estimating the two quantities enables the Dueling DQN to perform better in comparison to DQN. This recipe will walk you through the steps to implement a Dueling DQN agent from scratch using TensorFlow 2.x.
Getting ready
To complete this recipe, you will first need to activate the tf2rl-cookbook
Conda Python virtual environment and pip install -r requirements.txt
. If the following import statements run without issues, you are ready to get started!
import argparse import os import random from collections import deque from datetime import datetime import gym import numpy as np import tensorflow as tf from...