GithubHelp home page GithubHelp logo

ml-hmm's Introduction

hmm

HMM

HMM(self, num_states, data_dim, hmm_type='fully-connected')

A Hidden Markov Model class on top of the Tensorflow library. At the moment, the class supports only Gaussian emission distributions. The class will also support discrete multivariate and Gaussian Mixture Models as emission distributions. The class is licensed under the MIT License.

posterior

HMM.posterior(self, data)

Runs the forward-backward algorithm in order to calculate the log-scale posterior probabilities.

Args: data: A numpy array with rank two or three.

Returns: A numpy array that contains the log-scale posterior probabilities of each time serie in data.

fit

HMM.fit(self, data, max_steps=100, batch_size=None, TOL=0.01, min_var=0.1, num_runs=1)

Implements the Baum-Welch fitting algorithm.

Args: data: A numpy array with rank two or three. max_steps: Maximum number of steps. batch_size: None or the number of batch size. TOL: The tolerance for stoping the training process. min_var: Minimum variance num_runs: Number of training realizations. The best of all model is to be kept.

Returns: True if converged, False otherwise.

run_viterbi

HMM.run_viterbi(self, data)

Implements the viterbi decoding algorithm.

Args: data: A numpy array of rank two or three represents the observed data.

Returns: A numpy array contains he most probable hidden state paths.

generate

HMM.generate(self, num_samples)

Generate simulated data from the model.

Args: num_samples: The number of samples of the generated data.

Returns: The numpy array of the generated sequence of observations.

save_model

HMM.save_model(self, filename)

Saves the model parameters to a numpy file

Args: filename: The path to a numppy .npz file where the model parameters will be saved.

load_model

HMM.load_model(self, filename)

Loads the model parameters from a numpy file

Args: filename: The path to a numpy .npz file where the model parameters have been stored.

ml-hmm's People

Contributors

kesmarag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gowtham1997

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.