This code was executed in a virtual python environment using Python 3.9.
This Code belongs to the AutoML Conf 2024 Paper titeled "Bi-Level One-Shot Architecture Search for Probabilistic Time Series Forecasting".
This Code contains everything necessary to run experiments on the "Exchange" as well as "Power" dataset referenced in the paper.
To obtain the other dataset follow these steps:
M4
- Download the data from https://www.kaggle.com/datasets/yogesh94/m4-forecasting-competition-dataset/data
Solar, Wiki - Use get_dataset function of this library https://ts.gluon.ai/stable/tutorials/forecasting/quick_start_tutorial.html
- Call this function either with "solar_nips" or "wiki2000_nips"
All preprocessing steps and datasplits are automaticly conducted internally and identical to the procedure used for the paper
Store the .csv files (in case of M4) or a .pkl file of the data (in case of Solar, and Wiki) at the following places:
- Bi-level-optim/ArchSearch/darts/res/
- Bi-level-optim/ArchSearch/res/
- Bi-level-optim/PWN/res/
Call the corresponding folders either "M4", "solar_data", or "wiki_data"
To run the architecture search use the train_search.py file in Bi-level-optim/ArchSearch/darts/
The standard experiment to run is a macro-architecture search for "Exchange".
If you like to run a different experiment setup use the options stated in lines 126 to 141.
Please set only one dataset flag to true at a time.
cd Bi-level-optim/ArchSearch/darts/
python train_search.py
To train PWN, either standard or with an optimized architecture use the training.py file in Bi-level-optim/PWN/
The standard experiment to run is the training of an optimized architecture for "Exchange".
cd Bi-level-optim/PWN/
python training.py
In line 26 and 58 you can choose wether or not to use an optimized architecture
If you want to run an experiment with the larger vanilla model mentioned in the paper set the
aforementioned options to False and set config.rnn_layer_config.n_layers in line 37 to 12.
To other experiments different experiments define your own at line 105 to 114 (multiple at oncee possible).
Possible selection options are:
- ReadX -> Choose the appropiate read function for your dataset
- PWN or PWNEM -> PWN uses CWSPN and PWNEM uses WEin as the PC
- config_c -> Replace with config_w if you use PWNEM
- context_timespan, prediction_timespan, timespan_step -> replace according to dataset
- use_transformer -> choose wether to use STrans
- smape_target -> Set to true if SMAPE is your metric (only for M4)
Important Notes: - batchsize and #epochs can be changed in line 152
- comment out all instances of config.window_size and config.fft_compression except for the one related to your dataset (line 80 to 99)
To use a new micro architecture for the SRNN and CWSPN copy the results of the architecture search (the arch. weight arrays) to pwn.py in
Bi-level-optim/PWN/model/ in line 21 (SRNN) or line 25 (CWSPN). If you use PWNEM you can do the same for a searched SRNN arch in file pwn_em.py
in the same folder.