Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ation into update
  • Loading branch information
dfulu committed Jun 18, 2024
2 parents b646970 + 114f5d7 commit 6a62f74
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pip install ".[dev]"

## Getting started with running PVNet summation

In order to run PVNet summation, we assume that you are already set up with
In order to run PVNet summation, we assume that you are already set up with
[PVNet](https://github.com/openclimatefix/PVNet) and have met all the requirements there.

Before running any code, copy the example configuration to a
Expand All @@ -34,35 +34,35 @@ You will be making local amendments to these configs.

### Datasets

The datasets required are the same as documented in
[PVNet](https://github.com/openclimatefix/PVNet). The only addition is that you will need PVLive
The datasets required are the same as documented in
[PVNet](https://github.com/openclimatefix/PVNet). The only addition is that you will need PVLive
data for the national sum i.e. GSP ID 0.


## Generating pre-made concurrent batches of data for PVNet

It is required that you preprepare batches using the `save_concurrent_batches.py` script from
PVNet. This saves the batches as required by the PVNet model to make predictions for all GSPs for
It is required that you preprepare batches using the `save_concurrent_batches.py` script from
PVNet. This saves the batches as required by the PVNet model to make predictions for all GSPs for
a single forecast init time. Seen the PVNet package for more details on this.


### Set up and config example for batch creation


The concurrent batches created in the step above will be augmented with a few additional pieces of
data required for the summation model. Within your copy of `PVNet_summation/configs` make sure you
data required for the summation model. Within your copy of `PVNet_summation/configs` make sure you
have replaced all of the items marked with `PLACEHOLDER`

### Training PVNet_summation

How PVNet_summation is run is determined by the extensive configuration in the config files. The
configs stored in `PVNet/configs.example` should work with batches created using the steps and
How PVNet_summation is run is determined by the extensive configuration in the config files. The
configs stored in `PVNet/configs.example` should work with batches created using the steps and
batch creation config mentioned above.

Make sure to update the following config files before training your model:

1. In `configs/datamodule/default.yaml`:
- update `batch_dir` to point to the directory you stored your concurrent batches in during
- update `batch_dir` to point to the directory you stored your concurrent batches in during
batch creation.
- update `gsp_zarr_path` to point to the PVLive data containing the national estimate
2. In `configs/model/default.yaml`:
Expand All @@ -74,7 +74,7 @@ Make sure to update the following config files before training your model:
4. In `configs.config.yaml`:
- It is recommended that you set `presave_pvnet_outputs` to `True`. This means that the
concurrent batches that you create will only be run through the PVNet model once before
training and their outputs saved, rather than being run on the fly on each batch throughout
training and their outputs saved, rather than being run on the fly on each batch throughout
training. This can speed up training significantly.


Expand Down
2 changes: 1 addition & 1 deletion pvnet_summation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""PVNet_summation"""
__version__ = "0.1.4"
__version__ = "0.1.4"
4 changes: 2 additions & 2 deletions pvnet_summation/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
)
else:
self.pvnet_output_shape = (317, self.pvnet_model.forecast_len)

self.use_weighted_loss = False

def predict_pvnet_batch(self, batch):
Expand Down Expand Up @@ -186,7 +186,7 @@ def validation_step(self, batch: dict, batch_idx):

losses = self._calculate_common_losses(y, y_hat)
losses.update(self._calculate_val_losses(y, y_hat))

# Store these to make horizon accuracy plot
self._horizon_maes.append(
{i: losses[f"MAE_horizon/step_{i:03}"].cpu().numpy() for i in range(self.forecast_len)}
Expand Down
2 changes: 1 addition & 1 deletion scripts/checkpoint_to_huggingface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Command line tool to push locally save model checkpoints to huggingface
use:
python checkpoint_to_huggingface.py "path/to/model/checkpoints" \
--local-path="~/tmp/this_model" \
Expand Down

0 comments on commit 6a62f74

Please sign in to comment.