Updated thesis
This commit is contained in:
@@ -39,7 +39,6 @@ class SimpleDiffusionModel(DiffusionModel):
|
||||
hidden_sizes: list,
|
||||
other_inputs_dim: int,
|
||||
time_dim: int = 64,
|
||||
dropout_rate: float = 0.2,
|
||||
):
|
||||
super(SimpleDiffusionModel, self).__init__(time_dim)
|
||||
|
||||
@@ -49,7 +48,6 @@ class SimpleDiffusionModel(DiffusionModel):
|
||||
nn.Linear(input_size + time_dim + other_inputs_dim, hidden_sizes[0])
|
||||
)
|
||||
self.layers.append(nn.ReLU())
|
||||
self.layers.append(nn.Dropout(dropout_rate))
|
||||
|
||||
for i in range(1, len(hidden_sizes)):
|
||||
self.layers.append(
|
||||
@@ -58,7 +56,6 @@ class SimpleDiffusionModel(DiffusionModel):
|
||||
)
|
||||
)
|
||||
self.layers.append(nn.ReLU())
|
||||
self.layers.append(nn.Dropout(dropout_rate))
|
||||
|
||||
self.layers.append(
|
||||
nn.Linear(hidden_sizes[-1] + time_dim + other_inputs_dim, input_size)
|
||||
|
||||
@@ -2,7 +2,9 @@ from src.utils.clearml import ClearMLHelper
|
||||
|
||||
#### ClearML ####
|
||||
clearml_helper = ClearMLHelper(project_name="Thesis/NrvForecast")
|
||||
task = clearml_helper.get_task(task_name="AQR: Non Linear + Load + Wind + PV + QE + NP")
|
||||
task = clearml_helper.get_task(
|
||||
task_name="AQR: GRU (8 - 512) + Load + Wind + PV + QE + NP"
|
||||
)
|
||||
task.execute_remotely(queue_name="default", exit_process=True)
|
||||
|
||||
from src.policies.PolicyEvaluator import PolicyEvaluator
|
||||
@@ -44,7 +46,7 @@ data_config.NOMINAL_NET_POSITION = True
|
||||
|
||||
data_config = task.connect(data_config, name="data_features")
|
||||
|
||||
data_processor = DataProcessor(data_config, path="", lstm=False)
|
||||
data_processor = DataProcessor(data_config, path="", lstm=True)
|
||||
data_processor.set_batch_size(512)
|
||||
data_processor.set_full_day_skip(False)
|
||||
|
||||
@@ -67,7 +69,7 @@ else:
|
||||
|
||||
model_parameters = {
|
||||
"learning_rate": 0.0001,
|
||||
"hidden_size": 256,
|
||||
"hidden_size": 512,
|
||||
"num_layers": 8,
|
||||
"dropout": 0.2,
|
||||
"time_feature_embedding": 5,
|
||||
@@ -81,25 +83,25 @@ time_embedding = TimeEmbedding(
|
||||
|
||||
# time_embedding = TrigonometricTimeEmbedding(data_processor.get_time_feature_size())
|
||||
|
||||
# lstm_model = GRUModel(
|
||||
# time_embedding.output_dim(inputDim),
|
||||
# len(quantiles),
|
||||
# hidden_size=model_parameters["hidden_size"],
|
||||
# num_layers=model_parameters["num_layers"],
|
||||
# dropout=model_parameters["dropout"],
|
||||
# )
|
||||
|
||||
non_linear_model = NonLinearRegression(
|
||||
lstm_model = GRUModel(
|
||||
time_embedding.output_dim(inputDim),
|
||||
len(quantiles),
|
||||
hiddenSize=model_parameters["hidden_size"],
|
||||
numLayers=model_parameters["num_layers"],
|
||||
hidden_size=model_parameters["hidden_size"],
|
||||
num_layers=model_parameters["num_layers"],
|
||||
dropout=model_parameters["dropout"],
|
||||
)
|
||||
|
||||
# non_linear_model = NonLinearRegression(
|
||||
# time_embedding.output_dim(inputDim),
|
||||
# len(quantiles),
|
||||
# hiddenSize=model_parameters["hidden_size"],
|
||||
# numLayers=model_parameters["num_layers"],
|
||||
# dropout=model_parameters["dropout"],
|
||||
# )
|
||||
|
||||
# linear_model = LinearRegression(time_embedding.output_dim(inputDim), len(quantiles))
|
||||
|
||||
model = nn.Sequential(time_embedding, non_linear_model)
|
||||
model = nn.Sequential(time_embedding, lstm_model)
|
||||
|
||||
model.output_size = 1
|
||||
optimizer = torch.optim.Adam(model.parameters(), lr=model_parameters["learning_rate"])
|
||||
|
||||
@@ -2,7 +2,7 @@ from src.utils.clearml import ClearMLHelper
|
||||
|
||||
clearml_helper = ClearMLHelper(project_name="Thesis/NrvForecast")
|
||||
task = clearml_helper.get_task(
|
||||
task_name="Diffusion Training: hidden_sizes=[2048, 2048, 2048] (300 steps), lr=0.0001, time_dim=8"
|
||||
task_name="Diffusion Training (GRUs): hidden_sizes=[1024, 1024] (300 steps), lr=0.0001, time_dim=8 + NRV + L + W + PV + NP",
|
||||
)
|
||||
task.execute_remotely(queue_name="default", exit_process=True)
|
||||
|
||||
@@ -19,20 +19,20 @@ from src.policies.PolicyEvaluator import PolicyEvaluator
|
||||
data_config = DataConfig()
|
||||
data_config.NRV_HISTORY = True
|
||||
|
||||
data_config.LOAD_HISTORY = False
|
||||
data_config.LOAD_FORECAST = False
|
||||
data_config.LOAD_HISTORY = True
|
||||
data_config.LOAD_FORECAST = True
|
||||
|
||||
data_config.PV_FORECAST = False
|
||||
data_config.PV_HISTORY = False
|
||||
data_config.PV_FORECAST = True
|
||||
data_config.PV_HISTORY = True
|
||||
|
||||
data_config.WIND_FORECAST = False
|
||||
data_config.WIND_HISTORY = False
|
||||
data_config.WIND_FORECAST = True
|
||||
data_config.WIND_HISTORY = True
|
||||
|
||||
data_config.NOMINAL_NET_POSITION = False
|
||||
data_config.NOMINAL_NET_POSITION = True
|
||||
|
||||
data_config = task.connect(data_config, name="data_features")
|
||||
|
||||
data_processor = DataProcessor(data_config, path="", lstm=False)
|
||||
data_processor = DataProcessor(data_config, path="", lstm=True)
|
||||
data_processor.set_batch_size(64)
|
||||
data_processor.set_full_day_skip(True)
|
||||
|
||||
@@ -42,28 +42,28 @@ print("Input dim: ", inputDim)
|
||||
model_parameters = {
|
||||
"epochs": 15000,
|
||||
"learning_rate": 0.0001,
|
||||
"hidden_sizes": [2048, 2048, 2048],
|
||||
"hidden_sizes": [1024, 1024],
|
||||
"time_dim": 8,
|
||||
}
|
||||
|
||||
model_parameters = task.connect(model_parameters, name="model_parameters")
|
||||
|
||||
#### Model ####
|
||||
model = SimpleDiffusionModel(
|
||||
96,
|
||||
model_parameters["hidden_sizes"],
|
||||
other_inputs_dim=inputDim[1],
|
||||
time_dim=model_parameters["time_dim"],
|
||||
)
|
||||
|
||||
# model = GRUDiffusionModel(
|
||||
# model = SimpleDiffusionModel(
|
||||
# 96,
|
||||
# model_parameters["hidden_sizes"],
|
||||
# other_inputs_dim=inputDim[2],
|
||||
# other_inputs_dim=inputDim[1],
|
||||
# time_dim=model_parameters["time_dim"],
|
||||
# gru_hidden_size=128,
|
||||
# )
|
||||
|
||||
model = GRUDiffusionModel(
|
||||
96,
|
||||
model_parameters["hidden_sizes"],
|
||||
other_inputs_dim=inputDim[2],
|
||||
time_dim=model_parameters["time_dim"],
|
||||
gru_hidden_size=512,
|
||||
)
|
||||
|
||||
### Policy Evaluator ###
|
||||
battery = Battery(2, 1)
|
||||
baseline_policy = BaselinePolicy(battery, data_path="")
|
||||
|
||||
Reference in New Issue
Block a user