Experiments

The full implementation of DPG can be downloaded from our GitHub (https://github.com/PacktPublishing/Python-Reinforcement-Learning-Projects). To train an agent for CartPole, run the following command under the src folder:

python train.py -t CartPole-v0 -d cpu

There are two arguments in train.py. One is -t, or --task, indicating the name of the classic control task you want to test. The other one is -d, or --device, which specifies the device (CPU or GPU) that you want to use to train the actor-critic network. Since the dimensions of the state spaces of these classic control tasks are relatively low compared to the Atari environment, using the CPU to train the agent is fast enough. It should only take several minutes to finish. ...

Get Python Reinforcement Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.