Code repository for MLHC 2019 paper Relaxed Weight Sharing: Effectively Modeling Time-Varying Relationships in Clinical Time-Series
lib/ contains implementation for mixLSTM
ARFshock/ contains code for ARF and shock dataset
mortality/ contains code for in hospitial mortality dataset
synthetic/ contains code for synthetic dataset
Follow directions to complete the set up for the MIMIC III Benchmark dataset for in-hospital mortality: https://github.com/YerevaNN/mimic3-benchmarks.
Follow directions in ARFshock_label to produce ARF and shock labels.
Run savedata.py using python2. Example code below where MIMIC III benchmark data is saved in data/mimic and data files for model training will be saved in data/mlhc2019_RWS
python savedata.py --datadir /data/mimic/ --savedir /data/mlhc2019_RWS/
The following exmple code will train mutliple models using the default settings described in LSTM11q_main.py for generating synthetic datasets. Each run requires that a runname and model be specified. Runname determines the name used when saving output. Model is a list that determines which models will be trained. Additional settings such as which GPU device to use can be changed using options such as cuda in the example code below. Data and save directories should also be modified either via options or set as defaults in LSTM11q_main.py. See LSTM11q_main.py for more details.
python LSTM11q_main.py --runname your_model_will_be_saved_as --synthstart True --model "nidLSTM 2" LSTM mow HyperLSTM --cuda 0
The following exmple code will train a model using the default settings described in LSTM11s_main.py. Each run requires that a runname, mode and model be specified. Runname determines the name used when saving output. Mode can be either “ARF” or “Shock” and determines the data/task. Model determines what kind of model will be trained. In the example a shiftLSTM-2 will be learned. Additional settings such as which GPU device to use can be changed using options such as cuda in the example code below. Data and save directories should also be modified either via options or set as defaults in LSTM11s_main.py. See LSTM11s_main.py for more details.
python LSTM11s_main.py --runname your_model_will_be_saved_as --mode ARF --model "shiftLSTM 2" --realstart True --cuda 1
The following exmple code will train a model using the default settings described in LSTM11r_main.py. Each run requires that a runname and model be specified. Runname determines the name used when saving output. Model determines what kind of model wil be trained. In the example a shiftLSTM-2 will be learned. Additional settings such as which GPU device to use can be changed using options such as cuda in the example code below. Data and save directories should also be modified either via options or set as defaults in LSTM11r_main.py. See LSTM11r_main.py for more details.
python LSTM11r_main.py --runname your_model_will_be_saved_as --model "shiftLSTM 2" --realstart True --cuda 1