-
-
Notifications
You must be signed in to change notification settings - Fork 887
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 wrappers.vector.TransformObs/Action
single obs/action space argument
#1288
Conversation
wrappers.vector.TransformObs/Action
single obs/action space argument
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.
Thanks for the PR,
I think the __init__
can be significantly simpler,
if action_space is None:
if single_action_space is not None:
self.single_action_space = single_action_space
self.action_space = batch_space(single_action_space, self.num_envs)
else:
self.action_space = action_space
if single_action_space is not None:
self.single_action_space = single_action_space
if action_space != batch_space(single_action_space, self.num_envs):
warn("The action space and the batched single action space don't match as expected.")
self.func = func
The vector wrapper will automatically do the variable forwarding so we don't need the new function either
Could you update and change for the transform obs wrapper
The extra stuff I'm doing with Also, I think you want is this: if action_space is None:
if single_action_space is not None:
self.single_action_space = single_action_space
self.action_space = batch_space(single_action_space, self.num_envs)
else:
self.action_space = action_space
if single_action_space is not None:
self.single_action_space = single_action_space
if self.action_space != batch_space(self.single_action_space, self.num_envs):
warn("The action space and the batched single action space don't match as expected.")
self.func = func |
If you're okay with the behaviour change, then I'll make the changes and resubmit. |
Yes, I think it should be fine |
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.
Thanks for the update, looks good.
If you could add these changes then good to merge
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.
Thanks for the changes, looks good
Description
Fixes #1287
Type of change
Please delete options that are not relevant.
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)