Implementing the experience memory

Let's implement an experience memory class to store the experiences collected by the agent. Before that, let's cement our understanding of what we mean by experience. In reinforcement learning where the problems are represented using Markov Decision Processes (MDP), which we discussed in Chapter 2, Reinforcement Learning and Deep Reinforcement Learning, it is efficient to represent one experience as a data structure that consists of the observation at time step t, the action taken following that observation, the reward received for that action, and the next observation (or state) that the environment transitioned to due to the agent's action. It is useful to also include the "done" Boolean value that signifies ...

Get Hands-On Intelligent Agents with OpenAI Gym 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.