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

env.observation_space.high does not define the true maximum observations in the dataset #18

Closed
enjeeneer opened this issue Oct 13, 2022 · 2 comments

Comments

@enjeeneer
Copy link

enjeeneer commented Oct 13, 2022

  • bauwerk version: 0.21
  • Python version: 3.8
  • Operating System: macOS

Description

The hard-coded upper limit on env.observation_space is unrealistically high for the load and pv_gen variables (dims 1 and 2 of the array printed below) i.e.

obs_high = []
for key, _ in env.observation_space.items():
    obs_high.append(env.observation_space[key].high)

print(np.concatenate(obs_high))

[7.500e+00 3.403e+38 3.403e+38 1.000e+00 1.000e+00]

This becomes problematic when one attempts to normalise the observation space using the floor env.observation_space.low and ceiling env.observation_space.high.

Looking through the repo, it seems the max value might be the load_scaling_factor and solar_scaling_factor for the load and pv_gen variables respectively? I see that default_load_data.txt and default_solar_data.txt are in [0, 1], and the load and pv_gen observations are the values from the .txt file multiplied by the scaling factor. Thoughts?

@enjeeneer enjeeneer changed the title env.observation_space.high does not represent the realistic maximum observations in the dataset env.observation_space.high does not define the true maximum observations in the dataset Oct 13, 2022
@rdnfn
Copy link
Owner

rdnfn commented Oct 13, 2022

Thanks a lot for raising this, very good points!

The very high observation space bounds is an issue that is separate from the scaling factors. These bounds are set like

gym.spaces.Box(
    low=0, high=np.finfo(np.float32).max, shape=(1,), dtype=np.float32
)

In the main SolarBatteryEnv class. The bounds are set to the highest possible value as I assume we don't know the actual bounds (as we potentially wouldn't in a real world scenario), but it may be worth changing - as obviously in Bauwerk itself we have access to this information.

The second issue is more concerning, I will add my findings in #19.

@rdnfn
Copy link
Owner

rdnfn commented Oct 27, 2022

Good news: the suggested update to the obs spaces has been implemented and a normalisation wrapper added with v0.3.0. Thus closing this issue.

@rdnfn rdnfn closed this as completed Oct 27, 2022
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

2 participants