Giter Club home page Giter Club logo

bosd's Introduction

Online Hidden-semi Markov Models for Bayesian Online Detection and Prediction of Change Points

Implementation of Online HSMMs which eases the implementation of custom emission processes. In particular, emission processes which jointly depend on the hidden state and duration are supported.

There is also a python script for plotting the inferences drawn from the model.

Requirements

The framework requires the following ubuntu packages:

sudo apt-get install libboost-all-dev nlohmann-json-dev libarmadillo-dev cmake

Once you have installed these basic dependencies you can use some vanilla emission processes (e.g., i.i.d. Gaussian model) and create your own custom emission models. If you want to reproduce the paper results and/or use other already-implemented more advanced observation models you'll need to install two extra dependencies:

  • mlpack 3.0.4
  • Probabilistic Movement Primitives (ProMPs)

Installation instructions for mlpack can be foud here and for ProMPs go here. Please note that both dependencies are built similarly to this project using cmake, which make things easier.

Building

Follow the standard procedure for building cmake projects. Once you are in the repository main directory type:

mkdir build
cd build
cmake ..
make
make test #optional (Tests that the compiled library passes the test cases)

The latter will only build executables for which the dependencies are fulfilled. Make sure your mlpack and ProMPs installations are discoverable by cmake if you want to build their respective examples.

Examples

Examples of HSMMs with different emission processes can be found in the examples folder distributed with the code.

Plots

The paper plots can be reproduced by typing the following commands in the plots directory of this repository.

sh plot_cmd_synth
sh plot_cmd_ecg

As a result you'll get the following plots:

Synthetic experiment:

alt text

ECG experiment:

alt text

The sh scripts call the plotting script with the right arguments to get the same plots reported in the paper. Note that you don't need to install anything to obtain the plots given that the output inferences of the model are included in the repository as matrices.

The output matrices for the EEG/EMG experiment are not provided because they would increase the repository size considerably. Instructions about how to generate them once the project is built will be provided (TODO).

To reproduce the filtering posteriors:

ECG experiment:

./build/nn_promps_model_from_labels -i data/ecg/ecg.txt -l data/ecg/gt_vit_seq_ecg.txt \
-s 2 --mindur 50 --ndur 130 --notrans --nopi --noselftransitions \
--ms plots/ecg_experiment/mstates.txt \
--mr plots/ecg_experiment/mrunlength.txt \
--ml plots/ecg_experiment/mresidualtime.txt \
-t data/ecg/last_10_ecg.txt --nfiles 1

References

Please cite the paper Bayesian Online Detection and Prediction of Change Points (https://arxiv.org/abs/1902.04524) if you find this work useful.

bosd's People

Contributors

diegoae avatar

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.