PVNet 3.0.4__tar.gz → 3.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PVNet-3.0.4 → PVNet-3.0.6}/PKG-INFO +1 -1
- {PVNet-3.0.4 → PVNet-3.0.6}/PVNet.egg-info/PKG-INFO +1 -1
- PVNet-3.0.6/pvnet/__init__.py +2 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/base_model.py +13 -1
- {PVNet-3.0.4 → PVNet-3.0.6}/pyproject.toml +1 -1
- PVNet-3.0.4/pvnet/__init__.py +0 -2
- {PVNet-3.0.4 → PVNet-3.0.6}/LICENSE +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/MANIFEST.in +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/PVNet.egg-info/SOURCES.txt +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/PVNet.egg-info/dependency_links.txt +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/PVNet.egg-info/requires.txt +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/PVNet.egg-info/top_level.txt +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/README.md +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/callbacks.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/data/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/data/base.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/data/datamodule.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/data/pv_site_datamodule.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/data/utils.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/data/wind_datamodule.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/baseline/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/baseline/last_value.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/baseline/single_value.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/basic_blocks.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/deep_supervision.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/encoders/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/encoders/basic_blocks.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/encoders/encoders2d.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/encoders/encoders3d.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/encoders/encodersRNN.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/linear_networks/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/linear_networks/basic_blocks.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/linear_networks/networks.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/multimodal.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/nwp_weighting.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/site_encoders/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/site_encoders/basic_blocks.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/site_encoders/encoders.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/multimodal/weather_residual.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/models/utils.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/optimizers.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/training.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/pvnet/utils.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/requirements-dev.txt +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/requirements.txt +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/setup.cfg +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/setup.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/tests/__init__.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/tests/conftest.py +0 -0
- {PVNet-3.0.4 → PVNet-3.0.6}/tests/test_end2end.py +0 -0
|
@@ -471,11 +471,23 @@ class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
|
471
471
|
y_hat = self(batch)
|
|
472
472
|
# Sensor seems to be in batch, station, time order
|
|
473
473
|
y = batch[self._target_key][:, -self.forecast_len :, 0]
|
|
474
|
-
|
|
474
|
+
persistence = batch[self._target_key][:, -self.forecast_len - 1, 0]
|
|
475
|
+
# Expand persistence to be the same shape as y
|
|
476
|
+
persistence = persistence.unsqueeze(1).expand(-1, self.forecast_len)
|
|
475
477
|
losses = self._calculate_common_losses(y, y_hat)
|
|
476
478
|
losses.update(self._calculate_val_losses(y, y_hat))
|
|
477
479
|
|
|
478
480
|
logged_losses = {f"{k}/val": v for k, v in losses.items()}
|
|
481
|
+
logged_losses["MAE_persistence/val"] = F.l1_loss(persistence, y)
|
|
482
|
+
logged_losses["MSE_persistence/val"] = F.mse_loss(persistence, y)
|
|
483
|
+
# Log for each timestep the persistence loss
|
|
484
|
+
for i in range(self.forecast_len):
|
|
485
|
+
logged_losses[f"MAE_persistence/step_{i:03}/val"] = F.l1_loss(
|
|
486
|
+
persistence[:, i], y[:, i]
|
|
487
|
+
)
|
|
488
|
+
logged_losses[f"MSE_persistence/step_{i:03}/val"] = F.mse_loss(
|
|
489
|
+
persistence[:, i], y[:, i]
|
|
490
|
+
)
|
|
479
491
|
# Get the losses in the format of {VAL>_horizon/step_000: 0.1, VAL>_horizon/step_001: 0.2}
|
|
480
492
|
# for each step in the forecast horizon
|
|
481
493
|
# This is needed for the custom plot
|
PVNet-3.0.4/pvnet/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|