Closed KandBM closed 1 year ago
@KandBM thanks for raising this issue. The extra three observation in env.observation_space.shape[0]
are as a result of the NormalizedObservationWrapper
wrapper. The hour
, day
and month
observations are transformed to cyclic vectors. So they have sin
and cos
parts and 28 + three extra observations will give you 31.
So your observation space is correct. I just did not implement an observation_names
property in NormalizedObservationWrapper
to account for these three extra observations that get added during normalization.
You should be fine to use as-is if the agent you are using doesn't do anything with the observation_names
. I will work on updating NormalizedObservationWrapper
to return the correct list of observation names but it might not happen soon.
@kingsleynweye You're on the ball! I'm indeed still able to train and use the agent, but I'm masking part of the observations when producing adversarial examples and don't want to touch the calendar features. So if I've understood you correctly, observations[0:6] are the sin and cos for the calendar features?
@kingsleynweye You're on the ball! I'm indeed still able to train and use the agent, but I'm masking part of the observations when producing adversarial examples and don't want to touch the calendar features. So if I've understood you correctly, observations[0:6] are the sin and cos for the calendar features?
Yeah! The first six observations are the cos, sin of the three calendar features
@KandBM I think I fixed the problem in the mentioned pull request. However, I have not extensively tested it beyond using your example. I will hold off on releasing a new version until I test. Should happen sometime mid-September.
I will leave the issue open so that I remember.
This issue has been fixed since CityLearn==2.0.0
Issue Description
The list of observations names is smaller than the observation space returned by the environment. My observation space has 31 elements, but I only have the names for 28, and don't know which are unnamed.
Expected Behavior
I expect the environment would provide the name of each observation/feature in the observation space, so there'd be a name for every feature in the observation space.
Actual Behavior
The environment does not provide the name of each observation/feature in the observation space, as there are fewer names than features
Steps to Reproduce
Environment
Possible Solution
Sorry, no idea
Additional Notes
env.observation_names lists the observations which are active in the schema, but the env lists a larger observation space.