Skip to content

Source code for the paper: "Turning Dynamic Time Warping into Interpretable Recurrent Neural Network"

License

Notifications You must be signed in to change notification settings

0xjeffro/Neurlized-Dynamic-Time-Warping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neurlized-Dynamic-Time-Warping

Source code for the paper: "Turning Dynamic Time Warping into Interpretable Recurrent Neural Network"

Requirements

  • 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

Data

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

Run

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

About

Source code for the paper: "Turning Dynamic Time Warping into Interpretable Recurrent Neural Network"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages