October 2018
Intermediate to advanced
252 pages
6h 49m
English
One of the challenges that DQN needs to overcome is that the neural network used in the algorithm tends to forget the previous experiences as it overwrites them with new experiences. A list of previous experiences and observations is needed to retrain the model with the previous experiences. This array of experiences is called memory and we have use remember() function to append state, action, reward, and next_state to the memory.
The memory list in the following implementation will have this form:
memory = [(state, action, reward, next_state, done)...]
The remember function will store states, actions, and resulting rewards to the memory, as shown in the following snippet:
def remember(self, state, action, reward, ...