cchallu / spectranet

Apache License 2.0
23 stars 7 forks source link

SpectraNet: multivariate forecasting and imputation under distribution shifts and missing data

Contents

  1. Overview of Methodology
  2. Installation
  3. Organization
  4. How to run

Overview

In this work we tackle two widespread challenges in real applications that have been largely understudied: distribution shifts and missing data. We propose SpectraNet, a novel multivariate time-series forecasting model that dynamically infers a latent space spectral decomposition to capture current temporal dynamics and correlations. A Convolution Neural Network maps the learnt representation by sequentially mixing its components and refining the output. Our proposed approach can simultaneously forecast and interpolate past observations. SpectraNet achieves SoTA performance on synthetic data and five benchmark datasets with up to 92% less parameters and comparable training times with baselines. On settings with up to 80% missing data, SpectraNet has average performance improvements of almost 50% over the second best alternative.

Installation

We recommend installing Ananconda to run our code. To install Anaconda, review the installation instructions here.

To setup the environment using conda, run the following commands:

    # To create environment from environment.yml file
    foo@bar:~$ conda env create -f environment.yml

    # To activate the environment
    foo@bar:~$ conda activate spectranet 

    # To verify if the new environment was installed correctly
    foo@bar:~$ conda env list 

Organization

Datasets should be placed in the data folder, following ILI example included in this repo.


How to run

Run the following line to produce forecasts for each benchmark dataset. hyperopt_max_evals controls the number of steps of the HYPEROPT algorithm for hyperparameter selection, occlusion_size controls the size of the segments to occlude. The script will repeat the pipeline for different occlusion probabilities: 0, 20%, 40%, 60%, and 80%.

python run_spectranet.py --dataset 'ILI' --hyperopt_max_evals 15 --occlusion_size 10 --experiment_id "NAME"

Results will be stored in the results folder.