This is a pytorch version of the code for a quick implementation of the method mentioned in the article "Predicting Timing of Surgical Intervention Using Recurrent Neural Network for Necrotizing Pancreatitis".This code contains data preprocessing and data modeling analysis.
These methods include lstm-d, gru-d, plstm-d, Time weighted lstm-d, Time weighted gru-d, Time weighted plstm-d
-
Firstly, your data should be like below:
-
Then unzip the data file
cd /data
bash unzip.sh
-
Run the R code to produce the intermediate data that needs to be used later (Here, you need a R environment where the vision is greater than 3.3.0) run data_prepare.R in an environment of R, maybe you will do this in Rstudio or the R's own IDE.
-
Create the folders for saving result pictures and docs.
cd ./project
bash create_result_folder.sh
- Edit the --xs, --ma, --de, they represent the path of Xs.csv, mask.csv and deltat.csv, respectively. For the meaning of the datasets' names, you can read the paper. After editting, run the code below.
cd ./project
python main.py [-h] [--xs XS] [--ma MA] [--de DE] [--epoch EPOCH] [--lr LR]
[--mt MT] [--bat BAT] [--tp TP] [--seed SEED] [--bign BIGN]
[--hid HID] [--timew TIMEW]
or you can edit the train.sh, and then
bash train.sh