PVNet 3.0.43__tar.gz → 3.0.44__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.43 → pvnet-3.0.44}/PKG-INFO +1 -1
- {pvnet-3.0.43 → pvnet-3.0.44}/PVNet.egg-info/PKG-INFO +1 -1
- pvnet-3.0.44/pvnet/__init__.py +2 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/base_model.py +9 -4
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/multimodal.py +6 -1
- pvnet-3.0.43/pvnet/__init__.py +0 -2
- {pvnet-3.0.43 → pvnet-3.0.44}/LICENSE +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/MANIFEST.in +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/PVNet.egg-info/SOURCES.txt +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/PVNet.egg-info/dependency_links.txt +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/PVNet.egg-info/requires.txt +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/PVNet.egg-info/top_level.txt +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/README.md +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/callbacks.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/data/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/data/base.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/data/datamodule.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/data/pv_site_datamodule.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/data/utils.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/data/wind_datamodule.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/load_model.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/baseline/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/baseline/last_value.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/baseline/single_value.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/ensemble.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/basic_blocks.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/encoders/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/encoders/basic_blocks.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/encoders/encoders2d.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/encoders/encoders3d.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/encoders/encodersRNN.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/linear_networks/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/linear_networks/basic_blocks.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/linear_networks/networks.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/multimodal_base.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/site_encoders/__init__.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/site_encoders/basic_blocks.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/site_encoders/encoders.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/multimodal/unimodal_teacher.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/models/utils.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/optimizers.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/training.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pvnet/utils.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/pyproject.toml +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/setup.cfg +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/tests/test_end2end.py +0 -0
- {pvnet-3.0.43 → pvnet-3.0.44}/tests/test_utils.py +0 -0
|
@@ -245,7 +245,7 @@ class PVNetModelHubMixin(PyTorchModelHubMixin):
|
|
|
245
245
|
|
|
246
246
|
|
|
247
247
|
class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
248
|
-
"""
|
|
248
|
+
"""Abstract base class for PVNet submodels"""
|
|
249
249
|
|
|
250
250
|
def __init__(
|
|
251
251
|
self,
|
|
@@ -257,6 +257,7 @@ class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
|
257
257
|
interval_minutes: int = 30,
|
|
258
258
|
timestep_intervals_to_plot: Optional[list[int]] = None,
|
|
259
259
|
use_weighted_loss: bool = False,
|
|
260
|
+
forecast_minutes_ignore: Optional[int] = 0,
|
|
260
261
|
):
|
|
261
262
|
"""Abtstract base class for PVNet submodels.
|
|
262
263
|
|
|
@@ -270,6 +271,8 @@ class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
|
270
271
|
interval_minutes: The interval in minutes between each timestep in the data
|
|
271
272
|
timestep_intervals_to_plot: Intervals, in timesteps, to plot during training
|
|
272
273
|
use_weighted_loss: Whether to use a weighted loss function
|
|
274
|
+
forecast_minutes_ignore: Number of forecast minutes to ignore when calculating losses.
|
|
275
|
+
For example if set to 60, the model doesnt predict the first 60 minutes
|
|
273
276
|
"""
|
|
274
277
|
super().__init__()
|
|
275
278
|
|
|
@@ -292,10 +295,12 @@ class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
|
292
295
|
self.forecast_minutes = forecast_minutes
|
|
293
296
|
self.output_quantiles = output_quantiles
|
|
294
297
|
self.interval_minutes = interval_minutes
|
|
298
|
+
self.forecast_minutes_ignore = forecast_minutes_ignore
|
|
295
299
|
|
|
296
300
|
# Number of timestemps for 30 minutely data
|
|
297
301
|
self.history_len = history_minutes // interval_minutes
|
|
298
|
-
self.forecast_len = forecast_minutes // interval_minutes
|
|
302
|
+
self.forecast_len = (forecast_minutes - forecast_minutes_ignore) // interval_minutes
|
|
303
|
+
self.forecast_len_ignore = forecast_minutes_ignore // interval_minutes
|
|
299
304
|
|
|
300
305
|
self.weighted_losses = WeightedLosses(forecast_length=self.forecast_len)
|
|
301
306
|
|
|
@@ -334,7 +339,7 @@ class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
|
334
339
|
y_median = y_quantiles[..., idx]
|
|
335
340
|
return y_median
|
|
336
341
|
|
|
337
|
-
def
|
|
342
|
+
def _calculate_quantile_loss(self, y_quantiles, y):
|
|
338
343
|
"""Calculate quantile loss.
|
|
339
344
|
|
|
340
345
|
Note:
|
|
@@ -366,7 +371,7 @@ class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
|
366
371
|
losses = {}
|
|
367
372
|
|
|
368
373
|
if self.use_quantile_regression:
|
|
369
|
-
losses["quantile_loss"] = self.
|
|
374
|
+
losses["quantile_loss"] = self._calculate_quantile_loss(y_hat, y)
|
|
370
375
|
y_hat = self._quantiles_to_prediction(y_hat)
|
|
371
376
|
|
|
372
377
|
# calculate mse, mae
|
|
@@ -71,6 +71,7 @@ class Model(MultimodalBaseModel):
|
|
|
71
71
|
timestep_intervals_to_plot: Optional[list[int]] = None,
|
|
72
72
|
adapt_batches: Optional[bool] = False,
|
|
73
73
|
use_weighted_loss: Optional[bool] = False,
|
|
74
|
+
forecast_minutes_ignore: Optional[int] = 0,
|
|
74
75
|
):
|
|
75
76
|
"""Neural network which combines information from different sources.
|
|
76
77
|
|
|
@@ -131,6 +132,8 @@ class Model(MultimodalBaseModel):
|
|
|
131
132
|
the model to use. This allows us to overprepare batches and slice from them for the
|
|
132
133
|
data we need for a model run.
|
|
133
134
|
use_weighted_loss: Whether to use a weighted loss function
|
|
135
|
+
forecast_minutes_ignore: Number of forecast minutes to ignore when calculating losses.
|
|
136
|
+
For example if set to 60, the model doesnt predict the first 60 minutes
|
|
134
137
|
"""
|
|
135
138
|
|
|
136
139
|
self.include_gsp_yield_history = include_gsp_yield_history
|
|
@@ -154,6 +157,7 @@ class Model(MultimodalBaseModel):
|
|
|
154
157
|
interval_minutes=interval_minutes,
|
|
155
158
|
timestep_intervals_to_plot=timestep_intervals_to_plot,
|
|
156
159
|
use_weighted_loss=use_weighted_loss,
|
|
160
|
+
forecast_minutes_ignore=forecast_minutes_ignore,
|
|
157
161
|
)
|
|
158
162
|
|
|
159
163
|
# Number of features expected by the output_network
|
|
@@ -271,7 +275,8 @@ class Model(MultimodalBaseModel):
|
|
|
271
275
|
|
|
272
276
|
if self.include_sun:
|
|
273
277
|
self.sun_fc1 = nn.Linear(
|
|
274
|
-
in_features=2
|
|
278
|
+
in_features=2
|
|
279
|
+
* (self.forecast_len + self.forecast_len_ignore + self.history_len + 1),
|
|
275
280
|
out_features=16,
|
|
276
281
|
)
|
|
277
282
|
|
pvnet-3.0.43/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
|