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

Add policies arg callback on_episode_step #18119

Merged
merged 38 commits into from
Aug 27, 2021
Merged

Add policies arg callback on_episode_step #18119

merged 38 commits into from
Aug 27, 2021

Conversation

jsuarez5341
Copy link
Contributor

@jsuarez5341 jsuarez5341 commented Aug 26, 2021

Inconsistent callback signature: on_episode_step currently missing the "policies" arg. This prevents an important vector for smuggling data from the policy into the environment. A concrete example of this: Neural MMO environments render policy data as overlays on top of the env and need a way to get value function data etc to the render client.

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 :(

@jsuarez5341
Copy link
Contributor Author

@sven1977 PR as requested

@sven1977 sven1977 self-assigned this Aug 27, 2021
@sven1977 sven1977 self-requested a review August 27, 2021 12:55
@sven1977
Copy link
Contributor

Hey @jsuarez5341 , thank you! :)
Just added 2 things:

  • Make the policy arg None by default. That should make all the testing errors go away.
  • Use the policy arg to where the callback is actually done (in sampler.py).

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @jsuarez5341 ! :)

@sven1977
Copy link
Contributor

Just waiting for tests to pass ...

@sven1977 sven1977 merged commit 8136d29 into ray-project:master Aug 27, 2021
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.

3 participants