Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 23, 2024
1 parent 5236759 commit 5d97d1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,12 @@ def validation_step(self, batch: dict, batch_idx):
logged_losses["MSE_persistence/val"] = F.mse_loss(persistence, y)
# Log for each timestep the persistence loss
for i in range(self.forecast_len):
logged_losses[f"MAE_persistence/step_{i:03}/val"] = F.l1_loss(persistence[:, i], y[:, i])
logged_losses[f"MSE_persistence/step_{i:03}/val"] = F.mse_loss(persistence[:, i], y[:, i])
logged_losses[f"MAE_persistence/step_{i:03}/val"] = F.l1_loss(
persistence[:, i], y[:, i]
)
logged_losses[f"MSE_persistence/step_{i:03}/val"] = F.mse_loss(
persistence[:, i], y[:, i]
)
# Get the losses in the format of {VAL>_horizon/step_000: 0.1, VAL>_horizon/step_001: 0.2}
# for each step in the forecast horizon
# This is needed for the custom plot
Expand Down

0 comments on commit 5d97d1f

Please sign in to comment.