Fixed the non autoregressive final metric calculations
This commit is contained in:
@@ -2,7 +2,7 @@ from src.utils.clearml import ClearMLHelper
|
||||
|
||||
#### ClearML ####
|
||||
clearml_helper = ClearMLHelper(project_name="Thesis/NAQR: Linear")
|
||||
task = clearml_helper.get_task(task_name="NAQR: Non Linear")
|
||||
task = clearml_helper.get_task(task_name="NAQR: Linear + Load + PV + Wind + Net Position")
|
||||
task.execute_remotely(queue_name="default", exit_process=True)
|
||||
|
||||
from src.policies.PolicyEvaluator import PolicyEvaluator
|
||||
@@ -27,22 +27,22 @@ from src.models.time_embedding_layer import TimeEmbedding
|
||||
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.WIND_FORECAST = False
|
||||
data_config.WIND_HISTORY = False
|
||||
data_config.WIND_FORECAST = True
|
||||
data_config.WIND_HISTORY = True
|
||||
|
||||
data_config.PV_FORECAST = False
|
||||
data_config.PV_HISTORY = False
|
||||
data_config.PV_FORECAST = True
|
||||
data_config.PV_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.set_batch_size(512)
|
||||
data_processor.set_batch_size(64)
|
||||
data_processor.set_full_day_skip(True)
|
||||
|
||||
|
||||
@@ -72,9 +72,6 @@ model_parameters = {
|
||||
|
||||
model_parameters = task.connect(model_parameters, name="model_parameters")
|
||||
|
||||
time_embedding = TimeEmbedding(
|
||||
data_processor.get_time_feature_size(), model_parameters["time_feature_embedding"]
|
||||
)
|
||||
# lstm_model = GRUModel(
|
||||
# time_embedding.output_dim(inputDim),
|
||||
# len(quantiles),
|
||||
@@ -91,9 +88,9 @@ time_embedding = TimeEmbedding(
|
||||
# dropout=model_parameters["dropout"],
|
||||
# )
|
||||
|
||||
linear_model = LinearRegression(time_embedding.output_dim(inputDim), len(quantiles))
|
||||
linear_model = LinearRegression(inputDim, len(quantiles) * 96)
|
||||
|
||||
model = nn.Sequential(time_embedding, linear_model)
|
||||
model = linear_model
|
||||
model.output_size = 96
|
||||
optimizer = torch.optim.Adam(model.parameters(), lr=model_parameters["learning_rate"])
|
||||
|
||||
@@ -117,8 +114,8 @@ trainer = NonAutoRegressiveQuantileRegression(
|
||||
trainer.add_metrics_to_track(
|
||||
[PinballLoss(quantiles), MSELoss(), L1Loss(), CRPSLoss(quantiles)]
|
||||
)
|
||||
trainer.early_stopping(patience=10)
|
||||
trainer.plot_every(5)
|
||||
trainer.early_stopping(patience=5)
|
||||
trainer.plot_every(20)
|
||||
trainer.train(task=task, epochs=epochs, remotely=True)
|
||||
|
||||
### Policy Evaluation ###
|
||||
|
||||
Reference in New Issue
Block a user