Source code for the paper: "Turning Dynamic Time Warping into Interpretable Recurrent Neural Network"
- arff2pandas 1.0.1
- matplotlib 3.5.0
- numpy 1.21.4
- pandas 1.4.3
- scipy 1.9.3
- sklearn 0.0
- torch 1.10.0+cu113
- tqdm 4.61.2
The UCR datasets can be downloaded here: https://www.cs.ucr.edu/~eamonn/time_series_data_2018/ You can download and extract the zip file, and replace the original data directory. The directory structure should be:
.
├── LICENSE.md
├── README.md
├── datasets
│ ├── UCRArchive_2018
│ │ ├── ACSF1
│ │ │ ├── ACSF1_TEST.tsv
│ │ │ ├── ACSF1_TRAIN.tsv
│ │ │ └── README.md
│ │ ├── Adiac
│ │ │ ├── Adiac_TEST.tsv
│ │ │ ├── Adiac_TRAIN.tsv
│ │ │ └── README.md
│ │ ├── AllGestureWiimoteX
│ │ │ ├── AllGestureWiimoteX_TEST.tsv
│ │ │ ├── AllGestureWiimoteX_TRAIN.tsv
│ │ │ └── README.md
│ │ ...
│ └── process.py
├── main.py
├── main_imbalance.py
├── models
│ ├── DTW_RNN.py
│ └── handlers.py
├── results
│ └── prototypes
└── utils
├── evaluators.py
└── utils.py
There are two main entry files:
main.py
main_inbalance.py
The main experimental results are generated by main.py, and the main_imbalance.py generates the results for imbalanced settings.
If you have downloaded UCR data and place them into the right location, you can run.
python main.py --dataset ECG5000 --lr 0.05 --batch_size 2000 --k_shot 10 --scaling_rate 0.5