From e32874e9676f6e2b7731c1cc4538f5bedf1f9c32 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 18 Jun 2024 11:25:33 +0100 Subject: [PATCH 1/5] remove old experiment commands --- experiments.sh | 351 ------------------------------------------------- 1 file changed, 351 deletions(-) delete mode 100644 experiments.sh diff --git a/experiments.sh b/experiments.sh deleted file mode 100644 index d9369eaa..00000000 --- a/experiments.sh +++ /dev/null @@ -1,351 +0,0 @@ -# -*- coding: utf-8 -*- -# This is a log of the experiments run under PVNet2.1 - -set -e - - -if false -then - ################################################################################################ - # These have already been run. - # - # Note that this library has been refactored since these runs. So they will not work as they - # are written here - # - # A few small changes would bes required to re-run these. For example, in the first model below - # `pvnet.models.conv3d.encoders.DefaultPVNet2` should be replaced with - # `pvnet.models.multimodal.encoders.encoders3d.DefaultPVNet2` and - # `pvnet.models.conv3d.dense_networks.ResFCNet2` should be replaced with - # `pvnet.models.multimodal.linear_networks.networks.ResFCNet2` - - ################################################################################################ - - # Save pre-made batches - cd scripts - - python save_batches.py \ - +batch_output_dir="/mnt/disks/batches2/batches_v3.1" \ - +num_train_batches=50_000 +num_val_batches=2_000 \ - - cd .. - - # Set baseline to compare to - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet2 \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet2+ResFC2_slow_regx25_amsgrad_v0" - - # Use deep supervision to help break down the sources usefulness - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model._target_=pvnet.models.conv3d.deep_supervision.Model \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet2 \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet2+ResFC2_deepsuper_slow_regx25_amsgrad_v0" - - # Was the original encoder network better/worse/same? - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC2_slow_regx25_amsgrad_v0" - - # Are we using too much regularisation? - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet2 \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.01 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet2+ResFC2_slow_regx1_amsgrad_v0" - - # Set this baseline using NWP alone - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=nwp_dwsrf_weighting.yaml \ - model.optimizer._target_=pvnet.optimizers.Adam \ - model.optimizer.lr=0.0001 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="dwsrf_weighting_slow_v3" - - # Try a different encoder network - python run.py \ - datamodule.batch_dir="/mnt/disks/batches/batches_v3" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v3.yaml \ - model.encoder_kwargs.model_name="efficientnet-b2" \ - +model.add_image_embedding_channel=True \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.05 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="EffNet+ResFC2_slow_regx25_amsgrad_v1" - - # Use deep supervision and pvnet1 encoder so we can compare to pvnet2+deepsuper - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model._target_=pvnet.models.conv3d.deep_supervision.Model \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC2_deepsuper_slow_regx25_amsgrad_v0" - - # Reset this baseline for model trained under PVNet2.0 project - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model._target_=pvnet.models.conv3d.weather_residual.Model \ - +model.version=1 \ - model.add_image_embedding_channel=True \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - +model.optimizer.amsgrad=True \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC_weatherRes_slow_regx25_amsgrad_v1" - - - # What if we exclude historical GSP as input? - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.include_gsp_yield_history=False \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC2_slow_regx25_amsgrad_v1_nohist" - - - # How about a smaller encoder model? - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet \ - model.encoder_kwargs.number_of_conv3d_layers=2 \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet_shal+ResFC2_slow_regx25_amsgrad_v1" - - - # How about a bigger outout model? - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.output_network_kwargs.n_res_blocks=6 \ - model.output_network_kwargs.fc_hidden_features=128 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC2big_slow_regx25_amsgrad_v1" - - # Try the self-regularising neural network as the output network - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v4.yaml \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.DefaultPVNet \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.SNN \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.0001 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+SNN_slow_regx25_amsgrad_v0" - - # Try using ResNet encoder - python run.py \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.1" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v5.yaml \ - model._target_=pvnet.models.conv3d.deep_supervision.Model \ - model.image_encoder._target_=pvnet.models.conv3d.encoders.ResNet \ - model.output_network._target_=pvnet.models.conv3d.dense_networks.ResFCNet2 \ - model.sat_image_size_pixels=24 \ - model.nwp_image_size_pixels=24 \ - model.number_nwp_channels=2 \ - model.nwp_history_minutes=120 \ - model.nwp_forecast_minutes=480 \ - model.history_minutes=120 \ - model.optimizer._target_=pvnet.optimizers.AdamWReduceLROnPlateau \ - model.optimizer.lr=0.00005 \ - +model.optimizer.weight_decay=0.25 \ - +model.optimizer.amsgrad=True \ - +model.optimizer.patience=5 \ - +model.optimizer.factor=0.1 \ - +model.optimizer.threshold=0.002 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=4 \ - trainer.accumulate_grad_batches=32 \ - model_name="ResNet+ResFC2_deepsup_slow_regx25_amsgrad_v1" - - - cd scripts - - # Re-train this model after refactoring - python save_batches.py \ - +batch_output_dir="/mnt/disks/batches2/batches_v3.2" \ - +num_train_batches=200_000 \ - +num_val_batches=4_000 - - cd .. - - - python run.py \ - datamodule=premade_batches \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.2" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=conv3d_sat_nwp_v6.yaml \ - callbacks.early_stopping.patience=20 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC2+_slow_regx25_amsgrad_v4" - - -fi - -cd scripts - -# Changes in datapipes make this more like production -python save_batches.py \ - +batch_output_dir="/mnt/disks/batches2/batches_v3.4" \ - +num_train_batches=200_000 \ - +num_val_batches=4_000 - -cd .. - -python run.py \ - datamodule=premade_batches \ - datamodule.batch_dir="/mnt/disks/batches2/batches_v3.4" \ - +trainer.val_check_interval=10_000 \ - trainer.log_every_n_steps=200 \ - model=multimodal.yaml \ - model.include_gsp_yield_history=False \ - +model.min_sat_delay_minutes=30 \ - callbacks.early_stopping.patience=20 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - callbacks.early_stopping.patience=10 \ - datamodule.batch_size=32 \ - trainer.accumulate_grad_batches=4 \ - model_name="pvnet+ResFC2+_slow_regx25_amsgrad_v5_nohist" From 88dcf244c9234392c09289f5af68b66930a40a4e Mon Sep 17 00:00:00 2001 From: James Fulton Date: Wed, 19 Jun 2024 10:13:23 +0000 Subject: [PATCH 2/5] bug fix --- pvnet/models/multimodal/multimodal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pvnet/models/multimodal/multimodal.py b/pvnet/models/multimodal/multimodal.py index 2501b61e..a521761c 100644 --- a/pvnet/models/multimodal/multimodal.py +++ b/pvnet/models/multimodal/multimodal.py @@ -164,7 +164,6 @@ def __init__( if self.include_sat: # Param checks assert sat_history_minutes is not None - assert nwp_forecast_minutes is not None self.sat_sequence_len = ( sat_history_minutes - min_sat_delay_minutes From ff8a7feba950274a0a9ba06367e69f0b5f6f51e4 Mon Sep 17 00:00:00 2001 From: James Fulton Date: Wed, 19 Jun 2024 10:21:59 +0000 Subject: [PATCH 3/5] update datapipes for numpy v2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3a0a69b8..0ddb7bda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ dynamic = ["version", "readme"] license={file="LICENCE"} dependencies = [ - "ocf_datapipes>=3.3.6", + "ocf_datapipes>=3.3.34", "ocf_ml_metrics>=0.0.11", "numpy", "pandas", From ac59e69e3ec8f56cd3f75a6a80cccb963095dbdb Mon Sep 17 00:00:00 2001 From: BumpVersion Action Date: Wed, 19 Jun 2024 10:30:19 +0000 Subject: [PATCH 4/5] =?UTF-8?q?Bump=20version:=203.0.45=20=E2=86=92=203.0.?= =?UTF-8?q?46=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- pvnet/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index dc576daf..db06d920 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 3.0.45 +current_version = 3.0.46 message = Bump version: {current_version} → {new_version} [skip ci] [bumpversion:file:pvnet/__init__.py] diff --git a/pvnet/__init__.py b/pvnet/__init__.py index 0b854cd8..ac687aaf 100644 --- a/pvnet/__init__.py +++ b/pvnet/__init__.py @@ -1,2 +1,2 @@ """PVNet""" -__version__ = "3.0.45" +__version__ = "3.0.46" From bad52701a5252a2e0b8040e68d683bc52174b704 Mon Sep 17 00:00:00 2001 From: BumpVersion Action Date: Wed, 19 Jun 2024 11:30:13 +0000 Subject: [PATCH 5/5] =?UTF-8?q?Bump=20version:=203.0.46=20=E2=86=92=203.0.?= =?UTF-8?q?47=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- pvnet/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index db06d920..ba463ac7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 3.0.46 +current_version = 3.0.47 message = Bump version: {current_version} → {new_version} [skip ci] [bumpversion:file:pvnet/__init__.py] diff --git a/pvnet/__init__.py b/pvnet/__init__.py index ac687aaf..1548dadd 100644 --- a/pvnet/__init__.py +++ b/pvnet/__init__.py @@ -1,2 +1,2 @@ """PVNet""" -__version__ = "3.0.46" +__version__ = "3.0.47"