Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch 16. Using native python list instead of deque for storing experience, increases sampling performance considerably. #204

Merged
merged 2 commits into from
May 9, 2018

Conversation

psnilesh
Copy link
Contributor

@psnilesh psnilesh commented Mar 28, 2018

First of all, thanks for an amazing book and even more awesome github repo. It really help me pickup Deep RL. I tried training Breakout-v0 using your code and I found that the training slowed considerably as time went by. Replay buffer size was set to 1 million. Since collections.deque take O(n) time for random access, I believe it's not suitable for random sampling. I wrote a simple replay buffer that plays well with the rest of the code and uses native python list for storing samples. The performance gain is considerably large. I hope you find this change useful.

@ageron
Copy link
Owner

ageron commented Apr 4, 2018

Thanks @NileshPS , that's a very helpful contribution! :)
I took a quick look and it seems great, but I don't have time to test this right now. I'll merge as soon as I can test the code.
Thanks again!
Aurélien

@ageron ageron merged commit db8cd86 into ageron:master May 9, 2018
@ageron
Copy link
Owner

ageron commented May 9, 2018

Works great, thanks again @NileshPS ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants