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 6, 2024
1 parent dd2f469 commit 156fdfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def _log_validation_results(self, batch, y_hat, accum_batch_num):
"""Append validation results to self.validation_epoch_results"""

# get truth values, shape (b, forecast_len)
y = batch[self._target_key][:, -self.forecast_len:, 0]
y = batch[self._target_key][:, -self.forecast_len :, 0]
y = y.detach().cpu().numpy()
batch_size = y.shape[0]

Expand All @@ -626,7 +626,7 @@ def _log_validation_results(self, batch, y_hat, accum_batch_num):

# get time_utc, shape (b, forecast_len)
time_utc_key = BatchKey[f"{self._target_key_name}_time_utc"]
time_utc = batch[time_utc_key][:, -self.forecast_len:].detach().cpu().numpy()
time_utc = batch[time_utc_key][:, -self.forecast_len :].detach().cpu().numpy()

# get target id and change from (b,1) to (b,)
id_key = BatchKey[f"{self._target_key_name}_id"]
Expand Down

0 comments on commit 156fdfa

Please sign in to comment.