Skip to content

Commit

Permalink
log to csv only when end of accumbatch
Browse files Browse the repository at this point in the history
  • Loading branch information
AUdaltsova authored Sep 25, 2024
1 parent efbd95c commit ef0dd3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ def validation_step(self, batch: dict, batch_idx):
# Sensor seems to be in batch, station, time order
y = batch[self._target_key][:, -self.forecast_len :, 0]

self._log_validation_results(batch, y_hat, accum_batch_num)
if (batch_idx + 1) % self.trainer.accumulate_grad_batches == 0:
self._log_validation_results(batch, y_hat, accum_batch_num)

# Expand persistence to be the same shape as y
losses = self._calculate_common_losses(y, y_hat)
Expand Down

0 comments on commit ef0dd3f

Please sign in to comment.