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

fix: reward and discount spec not in wrapper #206

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

sash-a
Copy link
Collaborator

@sash-a sash-a commented Sep 8, 2023

The reward_spec and discount_spec methods are not in Wrapper. As such when wrapping an environment with a reward/discount spec that is not the default (shape=()), the reward and discount specs are set to the default unless they are specified again in the wrapper.

For example

class MyWrapper(Wrapper):
    def reset(self, key):
        do_some_stuff()
        return self._env.reset(key)

env = Connector()
wrapped = MyWrapper(env)

env.reward_spec() == wrapped.reward_spec()  # <-- false

@sash-a sash-a self-assigned this Sep 8, 2023
@sash-a sash-a added the bug Something isn't working label Sep 8, 2023
Copy link
Collaborator

@clement-bonnet clement-bonnet left a comment

Choose a reason for hiding this comment

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

Well spotted, thanks!

@clement-bonnet clement-bonnet merged commit e8d51e0 into instadeepai:main Sep 8, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants