-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Convert RL Unplugged Atari datasets to tianshou ReplayBuffer #621
Conversation
Codecov Report
@@ Coverage Diff @@
## master #621 +/- ##
==========================================
+ Coverage 93.48% 93.54% +0.06%
==========================================
Files 67 67
Lines 4433 4433
==========================================
+ Hits 4144 4147 +3
+ Misses 289 286 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Also, could you please write something in readme to demonstrate the step-by-step conversion process of rl-unplugged dataset? |
batch = _tf_example_to_tianshou_batch(example) | ||
buffer.add(batch) | ||
cnt += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use a batch-style process instead of a for-loop, e.g., directly set buffer._meta.obs = ... (or maybe we should create another API to support this thing?)
For example,
buffer = ReplayBuffer(500000)
# add first batch to initialize memory
batch = ...
buffer.add(batch)
# then directly set, I know it's ugly but this is the general idea
meta = buffer._meta
meta.obs = ...
meta.act = ...
...
buffer._meta = meta
make format
(required)make commit-checks
(required)Add a script to convert RL Unplugged Atari datasets to tianshou ReplayBuffer for better benchmarks. #612