bonsai-rx / machinelearning

Bonsai Library containing reactive infrastructure for machine learning
https://bonsai-rx.org/machinelearning/
MIT License
4 stars 4 forks source link

Introducing Online Inference with Hidden Markov Models (HMMs) #22

Closed ncguilbeault closed 2 months ago

ncguilbeault commented 4 months ago

Summary

This PR introduces a new package to the Bonsai.ML collection designed to perform online inference using Hidden Markov Models (HMMs).

Key Features

1. Online state inference

Users can infer the probabilities that the model is in a discrete latent state given new observations of data online.

2. Learning model parameters

Users can perform online learning of model parameters (initial state distribution, transition matrix, and emission probabilities) using mini batches of data without interrupting ongoing state inference.

3. Flexible model specification

Users can initialize the HMM using different model specifications, such as specifying different observation models (gaussian, exponential, etc.).

Implementation Details

Under the hood, the package uses the Bonsai - Python Scripting package to interface with the ssm package. The current implementation of the package exposes a high-level API that allows initializing HMMs, loading/saving model parameters, online learning, and inference, which is suitable for both novice and experienced Bonsai users.