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.
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
run_spectranet.py
: Runs SpectraNet results of the paper on a predefined benchmark dataset, one of [ILI, Exchange, ETTm2, Weather, solar]. The script will select optimal hyperparameters on the validation set, and produce forecasts for the test set.src/models/spectranet.py
: SpectraNet model.src/data/ts_dataset.py
: Custom Time-series Dataset class.src/hyperpar_selection.py
: Contains auxiliary functions and the hyperpar_selection
method to run the full pipeline.Datasets should be placed in the data
folder, following ILI example included in this repo.
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.