Deep reinforcement learning (DRL) extends reinforcement learning by using deep learning to solve the Q-equation or other reinforcement-learning functions. Neural networks replace state or Q-tables, making the approach suitable for environments with larger state and action spaces. section 11.2
A deep Q-learning system works as follows:
- Use a neural network instead of a state table or Q-table. section 11.2
- Use the Q-learning equation as the check or supervisor for network training. section 11.2
- Select actions in an environment, observe rewards and state transitions, and evaluate performance across episodes. section 11.2
Exploring Gym environments
A practical experiment creates a Gym environment such as CartPole, Acrobot, MountainCar, or LunarLander, inspects its action and observation spaces, runs episodes, accumulates rewards, and renders the resulting frames as video. section 11.2
Listing 11.11 EDL_11_2_Gym_Setup.ipynb: Creating a virtual display
#@title Setup Environment { run: "auto" }
ENVIRONMENT = "CartPole-v1" #@param ["CartPole-v1", "Acrobot-v1",
"CubeCrash-v0", "MountainCar-v0", "LunarLander-v2"] #1
env = gym.make(ENVIRONMENT) #2
state = env.reset()
plt.imshow(env.render(mode='rgb_array')) #3
print("action space: {0!r}".format(env.action_space)) #4
print("observation space: {0!r}".format #4
(env.observation_space)) #4
Set up a selectable Gym environment, reset it, render an observation, and inspect its action and observation spaces. section 11.2
