GithubHelp home page GithubHelp logo

antoninodimaggio / irradiance-rnn Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 4.0 499 KB

Recurrent neural network for forecasting solar irradiance :sunny:

License: MIT License

Python 100.00%
irradiance recurrent-neural-network nsrdb nrel pytroch renewable-energy solar-energy

irradiance-rnn's Introduction

Irradiance-RNN

Irradiance-RNN is a partially configurable Recurrent Neural Network (RNN) implementing Long-Short Term Memory (LSTM) layers designed to forecast solar irradiance.

license python

Introduction

The RNN is implemented using PyTorch. The solar irradiance data comes from the National Solar Radiation Database (NSRDB).

Data Preprocessing

  • Removal of entries with zero irradiance (early morning and night hours)
  • Normalization between 1 and -1 (LSTM layers use hyperbolic tangent)

Results

Results

Setup

Required

  • Python 3.6 +
  • Get an API key from NREL
  • Add your API access details to /Irradiance-RNN/config/config.example.json
  • Remove .example from /Irradiance-RNN/config/config.example.json
git clone https://github.com/antoninodimaggio/Irradiance-RNN.git
cd Irradiance-RNN
pip install -r requirements.txt

Download Training and Testing Data

  • Make sure that there is no space when using comma separated values
  • Detailed information on each argument can be found here
  • You could also use python download.py -h for help
python download.py --lat 33.2164 \
      --lon -97.1292 \
      --train-years 2010,2011 \
      --test-years 2012,2013 \
      --interval 30

Training

  • It is advised to change the --model-name after each run, otherwise a model with the same name will be overwritten.
  • Detailed information on each argument can be found here
  • You could also use python train.py -h for help
python train.py --lat 33.2164 \
      --lon -97.1292 \
      --train-years 2010,2011 \
      --seq-length 64 \
      --batch-size 64 \
      --model-name model \
      --start-date 2010-01-01 \
      --end-date 2011-06-01 \
      --hidden-size 35 \
      --num-layers 2 \
      --dropout 0.3 \
      --epochs 5 \
      --lr 1e-2 \
      --decay 1e-5 \
      --step-size 2 \
      --gamma 0.5

Evaluation and Plotting

  • Make sure that the arguments --seq-length, --model--name, hidden-size, and --num-layers are the same as what was used to train your model
  • Detailed information on each argument can be found here
  • You could also use python evaluate.py -h for help
python evaluate.py --lat 33.2164 \
      --lon -97.1292 \
      --test-years 2012 \
      --seq-length 64 \
      --model-name model \
      --start-date 2012-05-01 \
      --end-date 2012-06-01 \
      --hidden-size 35 \
      --num-layers 2 \
      --plot

Attributions/Thanks

  • This project would not be possible without the GPU access provided to me by Rutgers University's Department of Computer Science.
  • The inspiration behind this project comes from Alzahrani et al. who provided an initial RNN structure for me to get started.

irradiance-rnn's People

Contributors

antoninodimaggio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

irradiance-rnn's Issues

urllib.error.HTTPError: HTTP Error 400: Bad Request

Hi, May I ask you a question?
When trying to replicate your code, I encountered a problem and got the following error:“urllib.error.HTTPError: HTTP Error 400: Bad Request”. How can I resolve it, please?
Looking Forward.

About How to train multiple years?

Hi, May I ask you a question?
As you specified in the README, I did follow your instructions to train on 2010 year and test on 2011 year, But how could I train multiple years?
Looking Forward.

Ease of use

  • Implement command line arguments
  • Reorganize file structure (all files can be in the main directory)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.