-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
# CinC2020 | ||
# Contiformer | ||
|
||
This document gives an example on how to use the PhysioPro framework for [ContiFormer: Continuous-Time Transformer for Irregular Time Series Modeling](https://seqml.github.io/contiformer/). | ||
|
||
The example is based the solution of the 1st ranked team [Prna](https://ieeexplore.ieee.org/document/9344053). | ||
## Classification | ||
|
||
Here we take the `Heartbeat` classification task from [UEA & UCR Time Series Classification Repository](http://timeseriesclassification.com/dataset.php) as an example. | ||
|
||
## Scripts | ||
|
||
1. Download the dataset | ||
```bash | ||
# prepare data and features | ||
cd data/ | ||
|
||
# training data | ||
mkdir -p CinC2020/training_data | ||
wget -r -N -c -np https://physionet.org/files/challenge-2020/1.0.2/ # 10G | ||
find physionet.org/files/challenge-2020/1.0.2/training -name "*.hea" -exec mv {} CinC2020/training_data \; | ||
find physionet.org/files/challenge-2020/1.0.2/training -name "*.mat" -exec mv {} CinC2020/training_data \; | ||
cd PhysioPro | ||
mkdir data | ||
wget http://www.timeseriesclassification.com/aeon-toolkit/Archives/Multivariate2018_ts.zip -P data | ||
|
||
# features | ||
wget https://physionet.org/static/published-projects/challenge-2020/1.0.2/sources/Prna.zip | ||
unzip Prna.zip && rm Prna.zip | ||
mv Prna/physionet2020-submission/feats Prna/physionet2020-submission/records_stratified_10_folds_v2.csv Prna/physionet2020-submission/top_feats.npy CinC2020 | ||
rm -rf Prna | ||
unzip data/Multivariate2018_ts.zip -d data/ | ||
rm data/Multivariate2018_ts.zip | ||
``` | ||
|
||
# weights | ||
wget https://raw.githubusercontent.com/physionetchallenges/evaluation-2020/master/weights.csv -P CinC2020 | ||
|
||
# run training | ||
cd .. | ||
mkdir -p outputs/cinc2020 | ||
python -m physiopro.entry.train docs/configs/cinc2020.yml | ||
``` | ||
2. Run `Heartbeat` classification task with `TSRNN` model | ||
```bash | ||
# create the output directory | ||
mkdir -p outputs/Multivariate_ts/Heartbeat | ||
# run the train task | ||
python -m physiopro.entry.train docs/configs/contiformer_classification.yml | ||
# tensorboard | ||
tensorboard --logdir outputs/ | ||
``` | ||
|
||
The results will be saved to `outputs/Multivariate2018_ts/Heartbeat` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters