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

Change usages of reset() to obs, info = reset() #214

Merged
merged 22 commits into from
May 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert accidental debugging changes
  • Loading branch information
Elliot Tower committed May 15, 2023
commit b03ea94350981effcafbe339ae4c3a37721ae3a9
1 change: 0 additions & 1 deletion supersuit/utils/base_aec_wrapper.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ def reset(self, seed=None, options=None):
def observe(self, agent):
obs = super().observe(agent) # problem is in this line, the obs is sometimes a different size from the obs space
observation = self._modify_observation(agent, obs)
obs2 = super().observe(agent)
return observation

def step(self, action):
5 changes: 1 addition & 4 deletions supersuit/utils/basic_transforms/normalize_obs.py
Original file line number Diff line number Diff line change
@@ -34,8 +34,5 @@ def change_observation(obs, obs_space, min_max_pair):
min_res, max_res = (float(x) for x in min_max_pair)
old_size = obs_space.high - obs_space.low
new_size = max_res - min_res
try:
result = (obs - obs_space.low) / old_size * new_size + min_res
except ValueError:
return np.zeros(new_size)
result = (obs - obs_space.low) / old_size * new_size + min_res
return result