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

Bug in action spaces? #20

Open
Warry98 opened this issue Oct 4, 2022 · 0 comments
Open

Bug in action spaces? #20

Warry98 opened this issue Oct 4, 2022 · 0 comments

Comments

@Warry98
Copy link

Warry98 commented Oct 4, 2022

I was checking the code of the environment and noticed that an action wrapper is always used to normalize the actions, the code used for this is:

class NormalizedActions(gym.ActionWrapper):

    def _action(self, action):
        action = (action + 1) / 2
        action *= (self.action_space.high - self.action_space.low)
        action += self.action_space.low
        return action

    def action(self, action_):
        return self._action(action_)

    def _reverse_action(self, action):
        action -= self.action_space.low
        action /= (self.action_space.high - self.action_space.low)
        action = action * 2 - 1
        return action

But even though this wrapper is used, I believe that the action space doesn't get updated to account it, this causes the action limits to end up being the original ones instead of [-1, 1] which could cause compatibility problems with certain implementations in some of the scenarios.

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

No branches or pull requests

1 participant