Reinforcement Learning Code

In the theory video, sir taught us the importance of the memory of the agent and how we should discard the very old experiences from dequeue and use recent experience for training of agent. However, there is no such implementation (removing very old experience from dequeue) in the code. We’re just appending the experience and randomly drawing experiences equal to batch size.

Would it not affect the performance of the agent?

Hey @preetishvij, extremely sorry from our end for delay in reply.

No if you observe carefully, we have implemented that as well. We initialized memory with the,
self.memory = deque(maxlen=2000)

Now if you go indepth working of deque, you will find that very old experiences are being removed. This means when size of deque is 2000, and new experience come than very first experience from the deque is removed, and new experience is appended at the last. So we have implemented it like this.

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.