这是indexloc提供的服务,不要输入任何密码
Skip to content

Custom keys support in ReplayBuffer #903

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

Merged
merged 16 commits into from
Aug 10, 2023
Merged

Custom keys support in ReplayBuffer #903

merged 16 commits into from
Aug 10, 2023

Conversation

BFAnas
Copy link
Contributor

@BFAnas BFAnas commented Jul 26, 2023

  • I have marked all applicable categories:
    • exception-raising fix
    • algorithm implementation fix
    • documentation modification
    • new feature
  • I have reformatted the code using make format (required)
  • I have checked the code using make commit-checks (required)
  • If applicable, I have mentioned the relevant/related issue(s)
  • If applicable, I have listed every items in this Pull Request below

Issue: Custom keys support in ReplayBuffer #902
Modified ReplayBuffer add and __getitem__ methods.
Added test_custom_key() to test_buffer.py

@Trinkle23897 Trinkle23897 linked an issue Aug 9, 2023 that may be closed by this pull request
8 tasks
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2023

Codecov Report

Merging #903 (b9cfafc) into master (864ee3d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master     #903   +/-   ##
=======================================
  Coverage   91.10%   91.10%           
=======================================
  Files          73       73           
  Lines        5102     5106    +4     
=======================================
+ Hits         4648     4652    +4     
  Misses        454      454           
Flag Coverage Δ
unittests 91.10% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
tianshou/data/buffer/base.py 98.95% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -232,7 +232,7 @@ def add(
"""
# preprocess batch
new_batch = Batch()
for key in set(self._input_keys).intersection(batch.keys()):
for key in batch.keys():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change the above docstring accordingly? L223-L224 for example, not sure if there's any other place

@Trinkle23897 Trinkle23897 merged commit 80a698b into thu-ml:master Aug 10, 2023
BFAnas added a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
Issue: Custom keys support in ReplayBuffer thu-ml#902
Modified `ReplayBuffer` `add` and `__getitem__` methods.
Added `test_custom_key()` to test_buffer.py
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.

Custom keys support in ReplayBuffer
3 participants