Home

Awesome

<div align="center">

Improving day-ahead Solar Irradiance Time Series Forecasting by Leveraging Spatio-Temporal Context

python pytorch lightning hydra license

</div>

Description

This is the official repository to the paper "Improving day-ahead Solar Irradiance Time Series Forecasting by Leveraging Spatio-Temporal Context" by Oussama Boussif*, Ghait Boukachab*, Dan Assouline*, Stefano Massaroli, Tianle Yuan and professors Loubna Benabbou and Yoshua Bengio.

(* equal contribution)

In this paper, we present a deep learning framework, CrossViVit model, which leverages spatio-temporal context (e.g. satellite data) to improve the forecasting of solar irradiance at a particular meteorological station. In particular, CrossViViT exhibits zero-shot capabilities, generalizing well to unobserved solar stations.

My Image

https://github.com/gitbooo/CrossViVit/assets/12047248/95fd4b65-ce89-47e8-b987-bb73744498ec

Citation

If you use this codebase, or otherwise found our work valuable, please cite CrossViVit

@article{boussif2023improving,
  title   = {Improving day-ahead Solar Irradiance Time Series Forecasting by Leveraging Spatio-Temporal Context},
  author  = {Oussama Boussif and Ghait Boukachab and Dan Assouline and Stefano Massaroli and Tianle Yuan and Loubna Benabbou and Yoshua Bengio},
  year    = {2023},
  journal = {arXiv preprint arXiv: 2306.01112}
}

Dataset

You can view the dataset here and can you access it as follows:

import deeplake

ds = deeplake.load('hub://crossvivit/SunLake')

If you wish to download it you can do the following:

import deeplake

ds = deeplake.load('hub://crossvivit/SunLake')
local_dataset = ds.copy('/path/to/local/storage', num_workers=4)

Installation

Pip

# clone project
https://github.com/gitbooo/CrossViVit.git
cd CrossViVit

# [OPTIONAL] create conda environment
conda create -n myenv python=3.10
conda activate myenv

# install pytorch according to instructions
# https://pytorch.org/get-started/

# install requirements
pip install -r requirements.txt

Experiments

To help the users reproduce our results, we released the sbatch scripts that we used. This scripts are suited for clusters with SLURM and everything should run without any errors. If you do encounter errors, then please open an issue !

Hyperparameter tuning:

We use orion to optimize hyperparameters and it's well suited for launching distributed hyperparameter optimization on clusters. It also integrates nicely with pytorch-lightning as well as hydra through their hydra plugin, so make sure to check their repo if you want more information !

You can launch the hyperparameter optimization using the following command:

CUDA_VISIBLE_DEVICES=0 python main.py -m hparams_search=[replace_with_model_to_be_tuned] experiment=[replace_with_model_to_be_tuned] seed=42 resume=True

We attached a sbatch script for optimizing CrossViViT's hyperparameters that you can find here: sbatch_scripts/crossvivit_tuning.sh

Baselines

In addition to the main contributions presented in the paper, this repository also includes the implementation of several baseline models. These baselines serve as reference models or starting points for comparison and evaluation.

The following baseline models are included:

License

CrossViVit is licensed under the MIT License.

MIT License

Copyright (c) (2023) Ghait Boukachab

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.