June 2018
Intermediate to advanced
318 pages
9h 24m
English
The credit for the code used in this chapter goes to Giacomo Spigler's GitHub repository (https://github.com/spiglerg/DQN_DDQN_Dueling_and_DDPG_Tensorflow). Throughout this chapter, the code is explained at each and every line. For a complete structured code, check the above GitHub repository.
First, we import all the necessary libraries:
import numpy as npimport tensorflow as tfimport gymfrom gym.spaces import Boxfrom scipy.misc import imresizeimport randomimport cv2import timeimport loggingimport osimport sys
We define the EnvWrapper class and define some of the environment wrapper functions:
class EnvWrapper:
We define the __init__ method and initialize variables:
def __init__(self, env_name, debug=False): ...
Read now
Unlock full access