Skip to content

Conversation

@sven1977
Copy link
Contributor

@sven1977 sven1977 commented Nov 26, 2020

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

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

validate_spaces=validate_spaces,
before_init=before_init_fn,
after_init=setup_late_mixins,
before_loss_init=setup_late_mixins,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

# 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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prep for attention nets, where dynamic max'ing over the given sequences is not allowed.

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding "infos" to the collector's, if required.

@sven1977 sven1977 added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Nov 26, 2020
@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Nov 28, 2020
@ericl ericl merged commit 0df55a1 into ray-project:master Nov 28, 2020
@sven1977 sven1977 deleted the attention_nets_prep_0 branch March 27, 2021 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. tests-ok The tagger certifies test failures are unrelated and assumes personal liability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants