citylearn.dynamics module

class citylearn.dynamics.Dynamics[source]

Bases: object

Base building dynamics model.

reset()[source]
class citylearn.dynamics.LSTMDynamics(filepath: Union[pathlib.Path, str], input_observation_names: List[str], input_normalization_minimum: List[float], input_normalization_maximum: List[float], input_size: int, hidden_size: int, num_layers: int, lookback: int)[source]

Bases: citylearn.dynamics.Dynamics, torch.nn.modules.module.Module

LSTM building dynamics model that predicts indoor temperature based on partial cooling/heating load and other weather variables.

Parameters
  • filepath (Union[Path, str]) – Path to model state dictionary.

  • input_observation_names (List[str]) – List of maximum values used for input observation min-max normalization.

  • input_normalization_minimum (List[float]) – List of minumum values used for input observation min-max normalization.

  • input_normalization_maximum (List[float]) – List of maximum values used for input observation min-max normalization.

  • input_size (int) – Number of variables used for prediction. This may not equal input_observation_names e.g. cooling and heating demand may be included in input_observation_names but only one of two may be used for the actual prediction depending on building needs.

  • hidden_size (int) – The number of neurons in hidden layer.

  • num_layers (int) – Number of hidden layers.

  • lookback (int) – Number of samples used for prediction.

forward(x, h)[source]

Predict indoor dry bulb temperature.

init_hidden(batch_size: int)[source]

Initialize hidden states.

reset()[source]

Loads dynamic model state dict, and initializes hidden states and model input.

set_linear() torch.nn.modules.linear.Linear[source]

Initialize linear transformer.

set_lstm() torch.nn.modules.rnn.LSTM[source]

Initialize LSTM model.

terminate()[source]
training: bool