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

Feature/buffer np #169

Merged
merged 119 commits into from
Dec 19, 2023
Merged

Feature/buffer np #169

merged 119 commits into from
Dec 19, 2023

Conversation

belerico
Copy link
Member

Summary

In this PR we have introduced our new buffers, that handle data with standard dictionaries of numpy arrays instead of TensorDicts. This change has been introduced to keep algorithms implementation and interaction as simple as possible, while also gaining in terms of speed performance. In particular:

  • All the buffers have been converted to work with standard dictionaries of numpy arrays instead of TensorDicts
  • We have introduced the class sheeprl.utils.memmap.MemmapArray, which is a simple container to work with numpy memory-mapped arrays. Those arrays can be easily shared between processes that share the same underlying file-system and once shared they maintain the ownership of the array being shared
  • The EpisodeBuffer api has been made compliant to the ReplayBuffer api:
    • the add method takes in input one or more steps (possibly containing multiple episodes) instead of a single episode
  • The CheckpointCallback has been adapted to our new buffers

Type of Change

Please select the one relevant option below:

  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Please confirm that the following tasks have been completed:

  • I have tested my changes locally and they work as expected. (Please describe the tests you performed.)
  • I have added unit tests for my changes, or updated existing tests if necessary.
  • I have updated the documentation, if applicable.
  • I have installed pre-commit and run locally for my code changes.

Thank you for your contribution! Once you have filled out this template, please ensure that you have assigned the appropriate reviewers and that all tests have passed.

belerico and others added 30 commits October 5, 2023 22:01
@belerico belerico merged commit 6e5b31d into main Dec 19, 2023
9 checks passed
@belerico belerico deleted the feature/buffer-np branch December 21, 2023 14:46
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