-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[RLlib] Add on_episode_created
callback to SingleAgentEnvRunner
.
#49487
[RLlib] Add on_episode_created
callback to SingleAgentEnvRunner
.
#49487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Important change. Multiple users already requested this feature again.
@@ -393,6 +393,11 @@ def _sample( | |||
observation_space=self.env.single_observation_space, | |||
action_space=self.env.single_action_space, | |||
) | |||
self._make_on_episode_callback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, so this works again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, b/c the new gym 1.x does NOT automatically reset a done vector subenv anymore, but requires you to take the extra step from terminal observation to reset observation "manually". This allows us to slip in the callback again.
…on_episode_created_to_single_agent_env_runner
…ay-project#49487) Signed-off-by: Puyuan Yao <williamyao034@gmail.com>
Add
on_episode_created
callback toSingleAgentEnvRunner
.With gymnasium=1.x in place, making this callback is now supported (b/c of the extra step required to get from terminal state to reset state).
Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.