Provide interface where a single dataset can be used to define multiple episodes. Until now, a dataset was used to define 1 episode of training that was repeatedly used to reset the environment and train multiple episodes. Problem with this approach was that it didn't allow for shorter episodes such as daily or weekly episodes while maintaining a dataset of many days. It also meant that there had to be continuity in time series e.g. 3 months of data from different years could not be easily combined into a training dataset.
This pull request allows one to specify the length of each episode using the citylearn.citylearn.CityLearnEnv.episode_time_steps variable such that setting this value to say 24 will mean each episode is 24 hours long and during each call to citylearn.citylearn.CityLearnEnv.reset, a new 24 timestep sequence in the dataset will be used for training.
By default, citylearn.citylearn.CityLearnEnv.episode_time_steps is set to the usual length defined by simulation_start_time_step and simulation_end_time_step in schema.
Alternatively, for unequal episode lengths, one can set citylearn.citylearn.CityLearnEnv.episode_time_steps to a list of episode_start_time_step and episode_end_time_step pairs e.g. [[0, 10], [10, 50], [51, 60]].
Other variables like citylearn.citylearn.CityLearnEnv.rolling_episode_split can be used to True if episode sequences are split such that each time step is a candidate for episode_start_time_step otherwise, False to split episodes in steps of episode_time_steps.
citylearn.citylearn.CityLearnEnv.rolling_episode_split is True if episode splits i.e. episode_start_time_step and episode_end_time_step are to be selected at random during training otherwise, False to select sequentially.
Issue
NIL
Changes
See change log
Screenshots
NIL
Checklist
[x] I have tested the changes locally and they work as intended.
[x] I have updated the documentation, if applicable.
[x] I have added new tests, if applicable.
[x] I have added any required dependencies to the requirements.txt file, if applicable.
[x] I have followed the project's code style and conventions.
Description
Provide interface where a single dataset can be used to define multiple episodes. Until now, a dataset was used to define 1 episode of training that was repeatedly used to reset the environment and train multiple episodes. Problem with this approach was that it didn't allow for shorter episodes such as daily or weekly episodes while maintaining a dataset of many days. It also meant that there had to be continuity in time series e.g. 3 months of data from different years could not be easily combined into a training dataset.
This pull request allows one to specify the length of each episode using the
citylearn.citylearn.CityLearnEnv.episode_time_steps
variable such that setting this value to say24
will mean each episode is 24 hours long and during each call tocitylearn.citylearn.CityLearnEnv.reset
, a new 24 timestep sequence in the dataset will be used for training.By default,
citylearn.citylearn.CityLearnEnv.episode_time_steps
is set to the usual length defined bysimulation_start_time_step
andsimulation_end_time_step
inschema
.Alternatively, for unequal episode lengths, one can set
citylearn.citylearn.CityLearnEnv.episode_time_steps
to a list ofepisode_start_time_step
andepisode_end_time_step
pairs e.g.[[0, 10], [10, 50], [51, 60]]
.Other variables like
citylearn.citylearn.CityLearnEnv.rolling_episode_split
can be used to True if episode sequences are split such that each time step is a candidate forepisode_start_time_step
otherwise, False to split episodes in steps ofepisode_time_steps
.citylearn.citylearn.CityLearnEnv.rolling_episode_split
is True if episode splits i.e.episode_start_time_step
andepisode_end_time_step
are to be selected at random during training otherwise, False to select sequentially.Issue
NIL
Changes
See change log
Screenshots
NIL
Checklist
requirements.txt
file, if applicable.Additional notes
NIL