-
Notifications
You must be signed in to change notification settings - Fork 39
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/episode buffer np #121
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… into feature/episode_buffer_np
… into feature/episode_buffer_np
… into feature/episode_buffer_np
… into feature/episode_buffer_np
belerico
approved these changes
Oct 12, 2023
belerico
added a commit
that referenced
this pull request
Dec 19, 2023
* Add first PPO numpy buffer implementation * Add distribution cfg to agent * No need for tensordict * Add SAC numpy * Improve sample_next_obs * Add DV1 with numpy buffer * Too much reshapes * Add Sequential and EnvIndipendent np buffers * Fewer number of reshapes * Faster indexing + from_numpy parameter * Dreamer-V2 numpy * Fix buffer add * Better indexing * Fix indexes to sample * Fix metrics when they are nan * Fix reshape when bootstrapping + fix normalization * Guard timer metrics * np.intp for indexing * Change dtype after creating the tensor * Fix buf[key] after __getstate__ is called upon checkpoint * Securely close fd on __getstate__() * Add MemmapArray * Add __len__ function * Fix len * Better array setter and __del__ now controls ownership * Do not transfer ownership upon array setter * Add properties * Feature/episode buffer np (#121) * feat: added episode buffer numpy * fix: memmap episode buffer numpy * fix: checkpoint when memmap=True EpisodeBufferNumpy * fix: memmap episode buffer np * tests: added tests for episode buffer np * feat: update episode buffer, added MemmapArray * Fix not use self._obs_keys * Sample only if n > 0 * Fix shapes * feat: added possibility to specify sequence length in sample() + added possibility to add data only to some env * tests: update episode buffer numpy tests * tests: added replay buffer np tests * tests: added sequential replay buffer np tests * fix: env independent repla buffer name * fix: replay buffer + add tests * Safely release buffer on Windows * Safely delets memmaps * Del buffer * Safer array setter * Add Memmap.from_array * Fix ReplayBuffer __set_item__ * fix: sac_np sample * tests: update tests * tests: update * fix: sequential replay buffer sample clone * Add tests + Fix MemmapArray on Windows * Add tests to run only on Linux * Fix tests * Fix skip test on Windows * Dreamer-V2 with EpisodeBuffer np * Add user warning if file exists when creating a new MemmapArray * feat: added dreamer v3 np * Add docstrings + Fix array setter if shapes differ * Fix tests * Add docstring * Docstrings * fix: sample of env independent buffer * Fix locked tensordict * Add configs * feat: update np algorithms with new specifications * fix: mypy * PokemonRed env from https://github.com/PWhiddy/PokemonRedExperiments/blob/master/baselines/red_gym_env.py * Update dreamer_v3 with main * Update dreamer_v2 with main * Update dreamer_v1 with main * Update ppo with main * Update sac with main * Amend numpy to torch dtype and back dicts * feat: added np callback * fix: np callback * feat: add support functions in np checkpoint callback * feat: added droq np * feat: added ppo recurrent np * feat: added sac-ae np * Update dreamer algos with main * feat: added p2e dv1 np * feat: added p2e dv2 np * feat: add p2e dv3 np * feat: added ppo decoupled np * feat: add sac decoupled * np.tanh instead of torch.tanh * feat: from tensordict to buffers np * from td to np * exclude mlflow from tests * No more tensordict * Updated howto * Fix tests * .cpu().numpy() just one time * Removed old cfgs * Convert all when hydra instantiating * convert all on instantiate * [skip-ci] Removed pokemon files * fix: git merge related errors * Fix get absolute path * Amend dreamer-v3 pokemon config --------- Co-authored-by: michele-milesi <[email protected]> Co-authored-by: Michele Milesi <[email protected]>
belerico
added a commit
that referenced
this pull request
Dec 19, 2023
* Add first PPO numpy buffer implementation * Add distribution cfg to agent * No need for tensordict * Add SAC numpy * Improve sample_next_obs * Add DV1 with numpy buffer * Too much reshapes * Add Sequential and EnvIndipendent np buffers * Fewer number of reshapes * Faster indexing + from_numpy parameter * Dreamer-V2 numpy * Fix buffer add * Better indexing * Fix indexes to sample * Fix metrics when they are nan * Fix reshape when bootstrapping + fix normalization * Guard timer metrics * np.intp for indexing * Change dtype after creating the tensor * Fix buf[key] after __getstate__ is called upon checkpoint * Securely close fd on __getstate__() * Add MemmapArray * Add __len__ function * Fix len * Better array setter and __del__ now controls ownership * Do not transfer ownership upon array setter * Add properties * Feature/episode buffer np (#121) * feat: added episode buffer numpy * fix: memmap episode buffer numpy * fix: checkpoint when memmap=True EpisodeBufferNumpy * fix: memmap episode buffer np * tests: added tests for episode buffer np * feat: update episode buffer, added MemmapArray * Fix not use self._obs_keys * Sample only if n > 0 * Fix shapes * feat: added possibility to specify sequence length in sample() + added possibility to add data only to some env * tests: update episode buffer numpy tests * tests: added replay buffer np tests * tests: added sequential replay buffer np tests * fix: env independent repla buffer name * fix: replay buffer + add tests * Safely release buffer on Windows * Safely delets memmaps * Del buffer * Safer array setter * Add Memmap.from_array * Fix ReplayBuffer __set_item__ * fix: sac_np sample * tests: update tests * tests: update * fix: sequential replay buffer sample clone * Add tests + Fix MemmapArray on Windows * Add tests to run only on Linux * Fix tests * Fix skip test on Windows * Dreamer-V2 with EpisodeBuffer np * Add user warning if file exists when creating a new MemmapArray * feat: added dreamer v3 np * Add docstrings + Fix array setter if shapes differ * Fix tests * Add docstring * Docstrings * fix: sample of env independent buffer * Fix locked tensordict * Add configs * feat: update np algorithms with new specifications * fix: mypy * PokemonRed env from https://github.com/PWhiddy/PokemonRedExperiments/blob/master/baselines/red_gym_env.py * Update dreamer_v3 with main * Update dreamer_v2 with main * Update dreamer_v1 with main * Update ppo with main * Update sac with main * Amend numpy to torch dtype and back dicts * feat: added np callback * fix: np callback * feat: add support functions in np checkpoint callback * feat: added droq np * feat: added ppo recurrent np * feat: added sac-ae np * Update dreamer algos with main * feat: added p2e dv1 np * feat: added p2e dv2 np * feat: add p2e dv3 np * feat: added ppo decoupled np * feat: add sac decoupled * np.tanh instead of torch.tanh * feat: from tensordict to buffers np * from td to np * exclude mlflow from tests * No more tensordict * Updated howto * Fix tests * .cpu().numpy() just one time * Removed old cfgs * Convert all when hydra instantiating * convert all on instantiate * [skip-ci] Removed pokemon files * fix: git merge related errors * Fix get absolute path * Amend dreamer-v3 pokemon config * feat: added user choice from as_tensor and from_numpy in sample_tensors and to_tensor --------- Co-authored-by: belerico <[email protected]> Co-authored-by: belerico_t <[email protected]>
belerico
added a commit
that referenced
this pull request
Dec 19, 2023
* Add first PPO numpy buffer implementation * Add distribution cfg to agent * No need for tensordict * Add SAC numpy * Improve sample_next_obs * Add DV1 with numpy buffer * Too much reshapes * Add Sequential and EnvIndipendent np buffers * Fewer number of reshapes * Faster indexing + from_numpy parameter * Dreamer-V2 numpy * Fix buffer add * Better indexing * Fix indexes to sample * Fix metrics when they are nan * Fix reshape when bootstrapping + fix normalization * Guard timer metrics * np.intp for indexing * Change dtype after creating the tensor * Fix buf[key] after __getstate__ is called upon checkpoint * Securely close fd on __getstate__() * Add MemmapArray * Add __len__ function * Fix len * Better array setter and __del__ now controls ownership * Do not transfer ownership upon array setter * Add properties * Feature/episode buffer np (#121) * feat: added episode buffer numpy * fix: memmap episode buffer numpy * fix: checkpoint when memmap=True EpisodeBufferNumpy * fix: memmap episode buffer np * tests: added tests for episode buffer np * feat: update episode buffer, added MemmapArray * Fix not use self._obs_keys * Sample only if n > 0 * Fix shapes * feat: added possibility to specify sequence length in sample() + added possibility to add data only to some env * tests: update episode buffer numpy tests * tests: added replay buffer np tests * tests: added sequential replay buffer np tests * fix: env independent repla buffer name * fix: replay buffer + add tests * Safely release buffer on Windows * Safely delets memmaps * Del buffer * Safer array setter * Add Memmap.from_array * Fix ReplayBuffer __set_item__ * fix: sac_np sample * tests: update tests * tests: update * fix: sequential replay buffer sample clone * Add tests + Fix MemmapArray on Windows * Add tests to run only on Linux * Fix tests * Fix skip test on Windows * Dreamer-V2 with EpisodeBuffer np * Add user warning if file exists when creating a new MemmapArray * feat: added dreamer v3 np * Add docstrings + Fix array setter if shapes differ * Fix tests * Add docstring * Docstrings * fix: sample of env independent buffer * Fix locked tensordict * Add configs * feat: update np algorithms with new specifications * fix: mypy * PokemonRed env from https://github.com/PWhiddy/PokemonRedExperiments/blob/master/baselines/red_gym_env.py * Update dreamer_v3 with main * Update dreamer_v2 with main * Update dreamer_v1 with main * Update ppo with main * Update sac with main * Amend numpy to torch dtype and back dicts * feat: added np callback * fix: np callback * feat: add support functions in np checkpoint callback * feat: added droq np * feat: added ppo recurrent np * feat: added sac-ae np * Update dreamer algos with main * feat: added p2e dv1 np * feat: added p2e dv2 np * feat: add p2e dv3 np * feat: added ppo decoupled np * feat: add sac decoupled * np.tanh instead of torch.tanh * feat: from tensordict to buffers np * from td to np * exclude mlflow from tests * No more tensordict * Updated howto * Fix tests * .cpu().numpy() just one time * Removed old cfgs * Convert all when hydra instantiating * convert all on instantiate * [skip-ci] Removed pokemon files * fix: git merge related errors * Fix get absolute path * Amend dreamer-v3 pokemon config * feat: added keep_last parameter * docs: update * Removed dict from config --------- Co-authored-by: belerico <[email protected]> Co-authored-by: belerico_t <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Describe the purpose of the pull request, including:
Type of Change
Please select the one relevant option below:
Checklist
Please confirm that the following tasks have been completed: