[RLlib] Attention Net prep PR #1: Smaller cleanups.#12447
Merged
ericl merged 5 commits intoray-project:masterfrom Nov 28, 2020
Merged
[RLlib] Attention Net prep PR #1: Smaller cleanups.#12447ericl merged 5 commits intoray-project:masterfrom
ericl merged 5 commits intoray-project:masterfrom
Conversation
sven1977
commented
Nov 26, 2020
| validate_spaces=validate_spaces, | ||
| before_init=before_init_fn, | ||
| after_init=setup_late_mixins, | ||
| before_loss_init=setup_late_mixins, |
Contributor
Author
There was a problem hiding this comment.
This is the more accurate kwarg to use (torch did not have a loss init step before, so this is new). The old after_init still works the exact same and thus this does not cause an API-break.
sven1977
commented
Nov 26, 2020
| # RNN case: Mask away 0-padded chunks at end of time axis. | ||
| if state: | ||
| max_seq_len = tf.reduce_max(train_batch["seq_lens"]) | ||
| # Derive max_seq_len from the data itself, not from the seq_lens |
Contributor
Author
There was a problem hiding this comment.
Prep for attention nets, where dynamic max'ing over the given sequences is not allowed.
sven1977
commented
Nov 26, 2020
| episode._set_last_observation(agent_id, filtered_obs) | ||
| episode._set_last_raw_obs(agent_id, raw_obs) | ||
| episode._set_last_info(agent_id, infos[env_id].get(agent_id, {})) | ||
| # Infos from the environment. |
Contributor
Author
There was a problem hiding this comment.
Adding "infos" to the collector's, if required.
6 tasks
…ntion_nets_prep_0
ericl
approved these changes
Nov 28, 2020
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.
The current attention net trajectory view PR (#11729) is too large (>1000 lines added).
Therefore, I'm moving smaller preparatory and cleanup changes in ~2 pre-PRs. This is the first one of these.
Why are these changes needed?
Related issue number
Checks
scripts/format.shto lint the changes in this PR.