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 Jan 8, 2024
1 parent e0cc986 commit b28f0a1
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import pandas as pd
import torch
import torch.nn.functional as F
import wandb
import yaml
from huggingface_hub import ModelCard, ModelCardData, PyTorchModelHubMixin
from huggingface_hub.constants import CONFIG_NAME, PYTORCH_WEIGHTS_NAME
Expand All @@ -27,7 +26,7 @@
WeightedLosses,
)
from pvnet.optimizers import AbstractOptimizer
from pvnet.utils import construct_ocf_ml_metrics_batch_df, plot_batch_forecasts
from pvnet.utils import construct_ocf_ml_metrics_batch_df

DATA_CONFIG_NAME = "data_config.yaml"

Expand Down Expand Up @@ -485,24 +484,24 @@ def validation_step(self, batch: dict, batch_idx):
self._val_y_hats.append(y_hat)
self._val_batches.append(batch)
# if batch had accumulated
#if (batch_idx + 1) % self.trainer.accumulate_grad_batches == 0:
#y_hat = self._val_y_hats.flush()
#batch = self._val_batches.flush()

#fig = plot_batch_forecasts(
# batch,
# y_hat,
# quantiles=self.output_quantiles,
# key_to_plot="gsp" if self._target_key == BatchKey.gsp else "sensor",
#)

#self.logger.experiment.log(
# {
# f"val_forecast_samples/batch_idx_{accum_batch_num}": wandb.Image(fig),
# }
#)
#del self._val_y_hats
#del self._val_batches
# if (batch_idx + 1) % self.trainer.accumulate_grad_batches == 0:
# y_hat = self._val_y_hats.flush()
# batch = self._val_batches.flush()

# fig = plot_batch_forecasts(
# batch,
# y_hat,
# quantiles=self.output_quantiles,
# key_to_plot="gsp" if self._target_key == BatchKey.gsp else "sensor",
# )

# self.logger.experiment.log(
# {
# f"val_forecast_samples/batch_idx_{accum_batch_num}": wandb.Image(fig),
# }
# )
# del self._val_y_hats
# del self._val_batches

return logged_losses

Expand Down

0 comments on commit b28f0a1

Please sign in to comment.