All Projects → jambo6 → neuralRDEs

jambo6 / neuralRDEs

Licence: other
Code for: "Neural Rough Differential Equations for Long Time Series", (ICML 2021)

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to neuralRDEs

Deep-Signature-Transforms
Code for "Deep Signature Transforms" (NeurIPS 2019)
Stars: ✭ 65 (-36.27%)
Mutual labels:  signatures, rough-paths
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (-54.9%)
Mutual labels:  numerical-methods, time-series-analysis
signatory
Differentiable computations of the signature and logsignature transforms, on both CPU and GPU. (ICLR 2021)
Stars: ✭ 153 (+50%)
Mutual labels:  signatures, rough-paths
yara-parser
Tools for parsing rulesets using the exact grammar as YARA. Written in Go.
Stars: ✭ 69 (-32.35%)
Mutual labels:  signatures
minter-go-sdk
Minter Blockchain Golang SDK, 💳 wallet, 🧾 transactions, gRPC and HTTP clients 🌐 https://t.me/MinterGoSDK
Stars: ✭ 12 (-88.24%)
Mutual labels:  signatures
sig
Validate Method Arguments & Results in Ruby
Stars: ✭ 54 (-47.06%)
Mutual labels:  signatures
bip-schnorr
Pure JavaScript implementation of BIP340 Schnorr Signatures for secp256k1
Stars: ✭ 78 (-23.53%)
Mutual labels:  signatures
keygaen
Sign, verify, encrypt and decrypt data with PGP in your browser.
Stars: ✭ 78 (-23.53%)
Mutual labels:  signatures
pytkdocs
Load Python objects documentation.
Stars: ✭ 44 (-56.86%)
Mutual labels:  signatures
detection
Detection in the form of Yara, Snort and ClamAV signatures.
Stars: ✭ 70 (-31.37%)
Mutual labels:  signatures
signdocs
Full-stack clone of DocuSign
Stars: ✭ 58 (-43.14%)
Mutual labels:  signatures
httpsig
Golang implementation of the HTTP Signatures RFC draft, with SSH support!
Stars: ✭ 58 (-43.14%)
Mutual labels:  signatures
cryptouri.rs
Rust implementation of CryptoURI: URN-like namespace for cryptographic objects with Bech32-based encoding
Stars: ✭ 33 (-67.65%)
Mutual labels:  signatures
rsign2
A command-line tool to sign files and verify signatures in pure Rust.
Stars: ✭ 102 (+0%)
Mutual labels:  signatures
Kryptor
A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
Stars: ✭ 267 (+161.76%)
Mutual labels:  signatures
HTTPSignatures
A Burp Suite extension implementing the Signing HTTP Messages draft-ietf-httpbis-message-signatures-01 draft.
Stars: ✭ 38 (-62.75%)
Mutual labels:  signatures
nativescript-drawingpad
📝 NativeScript plugin to provide a way to capture any drawing (signatures are a common use case) from the device
Stars: ✭ 89 (-12.75%)
Mutual labels:  signatures
Sig
The most powerful and customizable binary pattern scanner
Stars: ✭ 131 (+28.43%)
Mutual labels:  signatures
Sigma
Generic Signature Format for SIEM Systems
Stars: ✭ 4,418 (+4231.37%)
Mutual labels:  signatures
salty
25519 for Cortex-M4 microcontrollers
Stars: ✭ 50 (-50.98%)
Mutual labels:  signatures

Neural Rough Differential Equations for Long Time Series
(ICML 2021)
[arXiv]

Overview

Neural Controlled Differential Equations (Neural CDEs) are the continuous-time analogue of an RNN. However, as with RNNs, training can quickly become impractical for long time series. Here we use rough path theory to extend this formulation through application of a pre-existing mathematical tool from rough analysis - the log-ODE method - which allows us to take integration steps larger than the discretisation of the data, resulting in significantly faster training times, with retainment (and often even improvements) in model performance.

Loosely speaking, this corresponds to binning the data prior to running a Neural CDE, with bin statistics carefully chosen to extract precisely the information most relevant to solving a CDE. We have traded in length for additional input channels, with this trade off coming at the cost of having two additional hyperparameters to tune.


Paper

This repository contains all the code for reproducing the experiments from the Neural Rough Differential Equations for Long Time Series paper.

Code

Code for constructing the log-signature NCDEs is in the ncdes/ folder and can be adapted to run your own models.

Library

We recommended checking out the torchcde project, which is a well maintained library for doing all things NCDE related, and now includes a log-ODE implementation.


Reproducing the Experiments

Setup the Environment

First to setup the environment, install the requirements with

  • pip install -r requirements.txt
  • pip install signatory==1.2.0.1.4.0 --no-cache-dir --force-reinstall

(Signatory has to be installed after PyTorch, due to limitations with pip).

Downloading the Data

Now setup a folder to save the data in at data/raw/. Here data/ should be made a symlink if you do not want to store the data in the project root.

Navigate into get_data/ and run

  • python get_data/uea.py
  • python get_data/tsr.py This will download the EigenWorms and BIDMC data to data/raw/ that was used in the paper (note that this can take a couple of hours as it downloads the entire UEA and TSR archives).

Run the Experiments

Finally, run the experiments. We provide a convenient script experiments/runs.py for doing this. Note that we need to run a hyperparameter optimization search and then the main run for each dataset. To run a hyperoptimzation followed and then the main experiment run navigate into experiments, open python and run

>>> import runs
>>> runs.run('UEA', 'EigenWorms', 'hyperopt')   # Syntax is run(dataset_folder, dataset_name, configuration_name)
# Once completed
>>> runs.run('UEA', 'EigenWorms', 'main')

This being an example for EigenWorms. For the BIDMC data it is just:

>>> import runs
>>> runs.run('TSR', 'BIDMC32{*}', 'hyperopt')   # Where {*} is one of {RR, HR, SpO2}
>>> runs.run('TSR', 'BIDM32{*}', 'main')

This will run on the cpu. If you have GPUs available and wish to run on the GPU (strongly recommended) we have an optional gpu_idxs argument that takes a list of gpu indexes. For example,

>>> runs.run('TSR', 'BIDM32RR', 'main', gpu_idxs=[0, 1])

will run the respiration rate runs on GPUs with indexes [0, 1].

We do have an option to run all the runs in one go

>>> runs.run(gpu_idxs=[0, 1])    # With user specified GPUs

but this is not recommended as it may take ~1-2 weeks.

Analysis of Results

Results will be saved to experiments/models/. To properly analyse them we recommend opening them in a jupyter notebook (see notebooks/{results, plots}.ipynb to reproduce the tables and figures from the paper), however for an overview one can use the parse_results.py file in experiments/ by running the following in the terminal

> python parse_results.py TSR BIDMC32RR hyperopt    # Arguments are the same as the runs.run function

this will print an overview of the results to the console.


Citation

@article{morrill2021neuralrough,
  title={Neural Rough Differential Equations for Long Time Series},
  author={Morrill, James and Salvi, Cristopher and Kidger, Patrick and Foster, James and Lyons, Terry},
  journal={International Conference on Machine Learning},
  year={2021}
}
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].