Code Monkey home page Code Monkey logo

gru_ode_bayes's Introduction

GRU-ODE-Bayes

This implementation completes the paper : GRU-ODE-Bayes : continuous modeling of sporadically-observed time series.

Modeling real-world multidimensional time series can be particularly challenging when these are sporadically observed (i.e., sampling is irregular both in time and across dimensions)---such as in the case of clinical patient data. To address these challenges, we propose (1) a continuous-time version of the Gated Recurrent Unit, building upon the recent Neural Ordinary Differential Equations (Chen et al. 2018), and (2) a Bayesian update network that processes the sporadic observations. We bring these two ideas together in our GRU-ODE-Bayes method.

This repository provides pytorch implementation of the GRU-ODE-Bayes paper.

Installation

Requirements

The code uses Python3 and Pytorch as auto-differentiation package. The following python packages are required and will be automatically downloaded when installing the gru_ode_bayes package:

numpy
pandas
sklearn
torch
tensorflow (for logging)
tqdm
argparse

Procedure

Install the main package :

pip install -e . 

And also the ODE numerical integration package :

cd torchdiffeq
pip install -e .

Run experiments

Experiments folder contains different cases study for the GRU-ODE-Bayes. Each trained model is then stored in the trained_models folder.

2-D Ornstein-Uhlenbeck SDE

Once in the double_OU folder, you can visualize some predictions of a previously trained model on newly generated data by running :

cd experiments/double_OU
python double_ou_gruode.py --demo

This will print 10 new realizations of the process along with the model predictions.

For retraining the full model, run:

python double_ou_gruode.py

Brusselator SDE

Similarly as for the 2D OU process,

cd experiments/Brusselator
python run_gruode.py --demo 

will plot 10 new realizations of the process along with the model predictions. For retraining the full model :

python run_gruode.py

USHCN daily (climate) data

For retraining the model, go to Climate folder and run

python climate_gruode.py

Datasets

The datasets for Brusselator, double OU and processed USHCN data have been uploaded on the repo for compatibility. The MIMIC dataset is not directly publicly available and was thus not pushed. It can be downloaded at : https://physionet.org/physiobank/database/mimic3cdb/

Folder 'data_preproc' contains all steps taken to preprocess the Climate and MIMIC datasets.

Acknowledgements and References

The torchdiffeq package has been extended from the original version proposed by (Chen et al. 2018)

Chen et al. Neural ordinary differential equations, NeurIPS, 2018.

For climate dataset :

Menne et al., Long-Term Daily Climate Records from Stations Across the Contiguous United States

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.