All Projects → mlech26l → ode-lstms

mlech26l / ode-lstms

Licence: MIT license
Code repository of the paper Learning Long-Term Dependencies in Irregularly-Sampled Time Series

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ode-lstms

PMMasterQuest
Take Paper Mario 64, buff old and new enemies to absurd levels, then rebalance Mario's overpowered strategies, and you've got one of the most difficult hacks of all time: Paper Mario Master Quest. The Discord:
Stars: ✭ 58 (-19.44%)
Mutual labels:  paper
Advances-in-Label-Noise-Learning
A curated (most recent) list of resources for Learning with Noisy Labels
Stars: ✭ 360 (+400%)
Mutual labels:  paper
Glowkit
A fork of the Paper (Bukkit) API for use in Glowstone
Stars: ✭ 17 (-76.39%)
Mutual labels:  paper
libpillowfight
Small library containing various image processing algorithms (+ Python 3 bindings) that has almost no dependencies -- Moved to Gnome's Gitlab
Stars: ✭ 60 (-16.67%)
Mutual labels:  paper
research-contributions
Implementations of recent research prototypes/demonstrations using MONAI.
Stars: ✭ 564 (+683.33%)
Mutual labels:  paper
KMRC-Papers
A list of recent papers regarding knowledge-based machine reading comprehension.
Stars: ✭ 40 (-44.44%)
Mutual labels:  paper
event-extraction-paper
Papers from top conferences and journals for event extraction in recent years
Stars: ✭ 54 (-25%)
Mutual labels:  paper
Awesome-Human-Activity-Recognition
An up-to-date & curated list of Awesome IMU-based Human Activity Recognition(Ubiquitous Computing) papers, methods & resources. Please note that most of the collections of researches are mainly based on IMU data.
Stars: ✭ 72 (+0%)
Mutual labels:  paper
PlantDoc-Dataset
Dataset used in "PlantDoc: A Dataset for Visual Plant Disease Detection" accepted in CODS-COMAD 2020
Stars: ✭ 114 (+58.33%)
Mutual labels:  paper
DecisionTrees
Seminar work "Decision Trees - An Introduction" with presentation, seminar paper, and Python implementation
Stars: ✭ 111 (+54.17%)
Mutual labels:  paper
Paper-clip
List of various interesting papers
Stars: ✭ 16 (-77.78%)
Mutual labels:  paper
Origami
Bukkit/Spigot/Paper based Minecraft server used by Minebench.de | Looking for an 1.17 version? If so most patches are PRd into Paper now, Origami 1.17 will continue once patches that Paper wont accept are necessary.
Stars: ✭ 29 (-59.72%)
Mutual labels:  paper
3DObjectTracking
Official Code: A Sparse Gaussian Approach to Region-Based 6DoF Object Tracking
Stars: ✭ 375 (+420.83%)
Mutual labels:  paper
dough
Library containing a lot of useful utility classes for the everyday Java and Spigot/Paper developer.
Stars: ✭ 26 (-63.89%)
Mutual labels:  paper
PQ-NET
code for our CVPR 2020 paper "PQ-NET: A Generative Part Seq2Seq Network for 3D Shapes"
Stars: ✭ 99 (+37.5%)
Mutual labels:  paper
STAWM
Code for the paper 'A Biologically Inspired Visual Working Memory for Deep Networks'
Stars: ✭ 21 (-70.83%)
Mutual labels:  paper
Awesome-Image-Matting
📓 A curated list of deep learning image matting papers and codes
Stars: ✭ 281 (+290.28%)
Mutual labels:  paper
deep-atrous-guided-filter
Deep Atrous Guided Filter for Image Restoration in Under Display Cameras (UDC Challenge, ECCV 2020).
Stars: ✭ 32 (-55.56%)
Mutual labels:  paper
triumph-gui
Simple lib to create inventory GUIs for Bukkit platforms.
Stars: ✭ 196 (+172.22%)
Mutual labels:  paper
AIPaperCompleteDownload
Complete download for papers in various top conferences
Stars: ✭ 64 (-11.11%)
Mutual labels:  paper

Learning Long-Term Dependencies in Irregularly-Sampled Time Series

This is the official code repository of the paper Learning Long-Term Dependencies in Irregularly-Sampled Time Series [arXiv link].

alt

Update January 2021 - PyTorch support added

Efficient and flexible PyTorch implementation added.

Supports adaptive step-size solvers through the TorchDyn package, as well as much faster but less precise custom implemented fixed-stepsize solvers.

The file torch_node_cell.py contains the implementation of the ODE-LSTM. The file pt_trainer.py uses PyTorch-Lightning to train a ODE-LSTM on some of the datasets of the paper. In particular, the PyTorch implementation give lightly better results than the TensorFlow implemenation.

Here is a subset of the available solver types:

  • dopri5 Dormand-Prince adaptive stepsize solver using TorchDyn package,
  • fixed_rk4 Fixed-stepsize 4-th order Runge-Kutta
  • fixed_heun Fixed-stepsize Heun's method solver
  • fixed_euler Fixed-stepsize explicit Euler method

Example usage

python3 pt_trainer.py --dataset person --solver fixed_rk4 --size 128 --epochs 50

Trains a ODE-LSTM of 128 units on the person activity dataset for 50 epochs.

Why the fixed-stepsize solvers? Similar to the issue of the Dormand-Prince solver implementation of the TensorFlow-probability package, the adaptive-stepsize solvers of the TorchDyn and the torchdiffeq only have limited support for requesting a batched solution time, i.e., each item of a batch may require a different solution time.

We implemented a workaround that simulates an entire batch at the union of the solution times in the batch, which may results in unnecessary computations. The custom implementation of the fixed-stepsize solvers are implemented with full support of batched solution times, thus are much faster (at the cost of lower numerical precision).

Requirements

Packages

  • Python 3.5 or newer
  • TensorFlow 2.0 or newer
  • (torch 1.7.1, torchdiffeq 0.1.1, torchdyn 0.2.2.1, torchsde 0.2.4)

Tested with python3.6/python3.5 and TensorFlow 2.1 on Ubuntu 18.04 and Ubuntu 16.04

Data preparation

Data for the XOR experiment are generated on the fly, i.e., no manual downloading necessary. The MNIST data are loaded through the tf.keras.datasets API, i.e., no manual downloading necessary. Data for the Walker kinematic and the person activity task however, must be downloaded first. This can be done by

source download_datasets.sh

Module description

  • node_cell.py: Implementation of all continuous-time RNNs used in the experimental evaluation in the paper
  • xor_task.py: Executable to run the synthetic XOR experiment (both the dense and the event-based modes)
  • person_activity.py: Executable to run the Person activity experiment
  • et_mnist.py: Executable to run the Event-based sequential MNIST experiment
  • walker_kinematic.py: Executable to run the Walker2d kinematic simulation experiment

Each of the four executable python scripts contain the code for loading and pre-processing the data, as well the code to train and evaluate the models.

Example usage

The four executable python scripts use some command line argument parsing to specify the RNN type and hyperparameters. The RNN type can be specified by --model RNN, where RNN is one of the following

--model RNN Description
lstm Augmented LSTM
ctrnn CT-RNN
node ODE-RNN
ctgru CT-GRU
grud GRU-D
gruode GRU-ODE
vanilla Vanilla RNN with time-dependent decay
bidirect Bidirectional RNN (LSTM with ODE-RNN)
phased PhasedLSTM
hawk Hawkes process LSTM
odelstm ODE-LSTM (ours)

For instance

python3 xor_task.py --model lstm --epochs 500 --dense

runs the XOR sequence classification experiment with the dense encoding (=regularly sampled time-series). By omitting the --dense flag one can run the same experiment but with the event-based encoding (=irregularly sampled time-series)

Logging

Each executable python script stores the result of the experiment in the directory results (which will be created if it does not exists). The results directory will have the following structure:

  • results/xor_event Results of the event-based XOR task
  • results/xor_dense Results of the dense encoded XOR task
  • results/smnist Results of the event-based sequential MNIST experiment
  • results/person_activity Results of the Person activity dataset
  • results/walker Results of the Walker2d kinematic simulation dataset

The results for different RNN types will be logged in separate files. For instance, results/xor_event/lstm_64.csv will contain the results of the augmented LSTM with 64 hidden units on the event-based XOR task. The naming of the RNN models is the same as for the --model argument as described above.

ODE solver choice

The following ODE solvers are available for running the ODE-RNNs:

  • euler: Fixed-stepsize explicit Euler's method
  • heun: Fixed-stepsize Heun's method
  • rk4: Fixed-stepsize 4th order Runge-Kutta
  • dopri5: Dormand and Prince adaptive stepsize solver

Choosing a fixed-stepsize solver also requires specifying the number of ODE solver steps unfoldings per RNN step. It is recommended to use a fixed-stepsize solver, due to the much faster runtime.

The Dormand and Prince adaptive stepsize solver uses the ODE solver implemented in the TensorFlow Probability package. This implementation does not support to specify batched solution times. As this feature is vital for irregularly sampled time-series, we had to implement a workaround to support it. Therefore, choosing this ODE solving method simulates more than necessary, which reduces the computational efficiency.

Citation

@article{lechner2020longterm,
	title={Learning Long-Term Dependencies in Irregularly-Sampled Time Series},
	author={Lechner, Mathias and Hasani, Ramin},
	journal={arXiv preprint arXiv:2006.04418},
	year={2020}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].