Implementation of Deep-Forecast using PyTorch

Wind Speed Prediction using LSTMs in PyTorch

Setup

Code Structure

  • "data" : Stores data and scripts to prepare dataset for training.
  • "lib" : Stores miscellaneous scripts for training and testing.
    • "arch.py" : Defines network architecture
    • "model.py" : Defines model (Minibatching mechanism, optimization, criterion, fit, predict, etc.)
    • "prediction.py" : Metrics and plots to evaluate the performance of the trained model
    • "data.py" : Creates training, validation and testings datasets
    • "loader.py" : Creates Dataset loader for PyTorch
  • "train.py" : Main training script.
  • "test.py" : Main testing script.
  • "settings.py" : Defines hyper-parameters of the model.

Data

  • Data is downloaded from IEM
  • Download data and save it under "data/raw"
  • To prepare dataset, run the scripts in "data/scripts"

Training and Testing

  • Train : python train.py --data [PATH OF PREPARED DATASET]
  • Test : python test.py --data [PATH OF PREPARED DATASET] --model [PATH OF THE SAVED MODEL]
  • For more info : python train.py --help, python test.py --help

train.py

  • It saves models and logs under "models"
  • At the end of the training, it saves predictions under "outputs"

test.py

  • It saves predictions under the directory of the model.

Sample Outputs

GitHub

https://github.com/Wizaron/deep-forecast-pytorch