Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/rm nowcasting utils #13

Merged
merged 20 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions pvnet_summation/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
import torch
import torch.nn.functional as F
import wandb
from nowcasting_utils.models.loss import WeightedLosses
from nowcasting_utils.models.metrics import (
mae_each_forecast_horizon,
mse_each_forecast_horizon,
)
from pvnet.models.base_model import BaseModel as PVNetBaseModel
from pvnet.models.base_model import PVNetModelHubMixin
from pvnet.models.utils import (
MetricAccumulator,
PredAccumulator,
WeightedLosses,
)
from pvnet.optimizers import AbstractOptimizer

Expand Down Expand Up @@ -187,8 +183,9 @@ def validation_step(self, batch: dict, batch_idx):
"MSE/val": F.mse_loss(y_sum, y),
"MAE/val": F.l1_loss(y_sum, y),
}
mse_each_step = mse_each_forecast_horizon(output=y_sum, target=y)
mae_each_step = mae_each_forecast_horizon(output=y_sum, target=y)

mse_each_step = torch.mean((y_sum - y) ** 2, dim=0)
mae_each_step = torch.mean(torch.abs(y_sum - y), dim=0)
gsp_sum_losses.update({f"MSE_horizon/step_{i:02}": m for i, m in enumerate(mse_each_step)})
gsp_sum_losses.update({f"MAE_horizon/step_{i:02}": m for i, m in enumerate(mae_each_step)})

Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
nowcasting_utils
ocf_datapipes>=3.0.0
pvnet>=2.6.2
ocf_ml_metrics
ocf_datapipes==3.0.*
pvnet==2.6.*
ocf_ml_metrics==0.0.*
numpy
pandas
matplotlib
Expand Down
Loading