So, we have implemented a memory system for the agent to store its past experience using a neat cyclic buffer. In this section, we will look at how we can use the experience memory to replay experience in the Q-learner class.
The following code snippet implements the replay_experience method that shows how we sample from the experience memory and call a soon-to-be-implemented method that lets the agent learn from the sampled batch of experiences:
def replay_experience(self, batch_size=REPLAY_BATCH_SIZE): """ Replays a mini-batch of experience sampled from the Experience Memory :param batch_size: mini-batch size to sample from the Experience Memory :return: None """ experience_batch ...