[RLlib] Cleanup examples folder #16: Add missing docstrings to 2 connector example scripts.#45864
Merged
sven1977 merged 11 commits intoray-project:masterfrom Jun 13, 2024
Conversation
…nup_examples_folder_16_docstrings_for_connector_examples
simonsays1980
approved these changes
Jun 12, 2024
| # Define env-to-module-connector pipeline for the new stack. | ||
| def _env_to_module_pipeline(env): | ||
| return [ | ||
| AddObservationsFromEpisodesToBatch(), |
Contributor
There was a problem hiding this comment.
Are the rest of the connectors now default?
Contributor
Author
There was a problem hiding this comment.
All off-the-shelf connectors now directly operate on the episodes now (except for framestacking for performance reasons):
- read last obs from episode
- alter that last obs
- directly write it back into the episode via
episode.set_observations.
This way, RLlib's default pieces (which come after the user defined ones) only see the already altered episode and thus properly extract the observations from those and put them into the RLModule batch.
This way, things work more uniformly. Reading the last obs from an episode and writing it back is super fast, b/c we are still operating on simple lists in the EnvRunner (not numpy'ized yet).
This file contains hidden or 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
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.
Cleanup examples folder #16: Add missing docstrings to 2 connector example scripts.
Why are these changes needed?
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.