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 Sep 27, 2023
1 parent 6c65f0a commit 9f7eb15
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,18 @@ def _calculate_common_losses(self, y, y_hat):
# calculate mse, mae with exp weighted loss
mse_exp = self.weighted_losses.get_mse_exp(output=y_hat, target=y)
mae_exp = self.weighted_losses.get_mae_exp(output=y_hat, target=y)

if self.use_quantile_regression:
# Take median value for remaining metric calculations
y_hat = self._quantiles_to_prediction(y_hat)

# Ramp Rate - % of GSP capacity per hour
start_step = 1
end_step = 3
interval_hours = (end_step - start_step)/2
interval_hours = (end_step - start_step) / 2
ramp_rate = y[:, end_step] - y[:, start_step] / interval_hours
ramp_rate_hat = y_hat[:, end_step] - y_hat[:, start_step] / interval_hours
ramp_rate_mae = F.l1_loss(ramp_rate_hat, ramp_rate)
ramp_rate_mae = F.l1_loss(ramp_rate_hat, ramp_rate)

# TODO: Compute correlation coef using np.corrcoef(tensor with
# shape (2, num_timesteps))[0, 1] on each example, and taking
Expand Down

0 comments on commit 9f7eb15

Please sign in to comment.