October 2018
Intermediate to advanced
472 pages
10h 57m
English
Let's define a deque object to store the information (state, action, reward, and done) related to every relevant step we take when playing the game. We will then be using the data stored in this deque object for training:
training_data = deque(maxlen=deque_len)
We have defined the deque object to be of a size of 20000. Once this container is filled with 20,000 data points, every new append being made at one end will result in popping a data point at the other end. Then, we will end up retaining only the latest information over time.
We will define a function called memory, which, when called during the game, will accept the information related to action, state, reward, and done as input at that time step, and then will ...
Read now
Unlock full access