Repository implementing ‘Improved Batching Strategy For Irregular Time-Series ODE’ https://arxiv.org/abs/2207.05708
This includes the implementation of our models, dataloaders, as well as a wrapper for ODE-RNN by Rubanova et al. (referred to as odeint).
First, install Pytorch and its related packages, and then install requirements.txt.
pip install --upgrade pip wheel
pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2+cu113 -f https://download.pytorch.org/whl/torch/ -f https://download.pytorch.org/whl/torchvision -f https://download.pytorch.org/whl/torchaudio/
pip3 install -r requirements.txt- Python 3.6 - 3.9 and CUDA 11.3
- Nvidia NGC PyTorch container 21.10 (nvcr.io/nvidia/pytorch:21.10-py3)
- MIMIC experiments requires minimum of 163 GB of CPU memory
- Ensure you are in the source folder (
src/for our model,src/odeintfor odeint) - To run a single experiment, use
train.pyfor our model, specifying which experiment you want to run with--experiment [syn|mujoco|mimic]flag - To run multiple experiments recreating the paper, run
src/schedule.shfor our model orsrc/odeint/schedule_int.shscripts for odeint. - The test result after training will be recorded in the
.outoutput file within thelightning_logsdirectory
All files with _int suffix are for Duvenaud's ODE-RNN model, otherwise are for our own model.
train.pyandodeint/train_int.pyare execution files for our model and odeint respectively.model.pyandodeint/model_int.pyare the model files.schedule.shandodeint/schedule_int.share scripts to run sample experiments for our model and odeint respectively.dataloader_mujoco.py,dataloader_phy.pyanddataloader_syn.pyare the dataloaders for Mujoco, MIMIC, and synthetic data respectively used to train the models.datafolder contains the data for MuJoCo experiments.paramsfolder contains the default hyperparameters for the experiments.
-
Request access to MIMIC-IV data and download MIMIC-IV v1.0 files
https://physionet.org/content/mimiciv/1.0/ -
Following the procedure from the repo of the paper "Neural flows: Efficient alternative to neural ODEs" by Biloˇs et al. (https://arxiv.org/abs/2110.13040), run all the notebooks except
mimic_prep.ipynbfrom the following repo. Finally rundatamerging.ipynbto yieldfull_dataset.csv
https://github.com/mbilos/neural-flows-experiments/tree/master/nfe/experiments/gru_ode_bayes/data_preproc -
Modify
get_data.pyat line 64 and insert a line to savefull_dataas a csv, then run it to obtain the csv file
https://github.com/mbilos/neural-flows-experiments/blob/master/nfe/experiments/gru_ode_bayes/lib/get_data.py
full_data.to_csv('data/MIMIC-IV-intercepted.csv')
- Run the python script
src/MIMIC-IV_processing.pyfrom this repo using the csv file obtained above
Reference:
- Marin Biloˇs, Johanna Sommer, Syama Sundar Rangapuram, Tim Januschowski, and Stephan G¨unnemann. Neural flows: Efficient alternative to neural ODEs. Advances in Neural Information Processing Systems, 2021.
- Yulia Rubanova, Ricky T. Q. Chen, and David K Duvenaud. Latent ordinary differential equations for irregularly-sampled time series.