#901 - Removed flatten from training configs

- Added flatten operation in observations.py when there are multiple obs components
- Updated config.rst docs
This commit is contained in:
SunilSamra
2023-07-17 13:44:16 +01:00
parent cb4089a0ba
commit 8008fab523
4 changed files with 5 additions and 7 deletions

View File

@@ -606,8 +606,6 @@ class ObservationsHandler:
# used for transactions and when flatten=true
self._flat_observation: np.ndarray
self.flatten: bool = False
def update_obs(self):
"""Fetch fresh information about the environment."""
current_obs = []
@@ -661,7 +659,7 @@ class ObservationsHandler:
@property
def space(self):
"""Observation space, return the flattened version if flatten is True."""
if self.flatten:
if len(self.registered_obs_components) > 1:
return self._flat_space
else:
return self._space
@@ -669,7 +667,7 @@ class ObservationsHandler:
@property
def current_observation(self):
"""Current observation, return the flattened version if flatten is True."""
if self.flatten:
if len(self.registered_obs_components) > 1:
return self._flat_observation
else:
return self._observation