hidden-markov-models

HMM for image sequence classification in OpenCV C++

时光毁灭记忆、已成空白 提交于 2019-12-07 06:52:23
问题 I am trying to classify 9 types of crops (Y) from 5 satellite images (X), acquired at dates t = {t1,...,t5}, corresponding to 5 crop phrenology states (S) i.e. preparation, seeding, growing, harvesting and post-harvesting stages. I am using similar training parcels throughout therefore the prior probabilities (initial probabilities) are equal. I have computed the likelihood model (Emission Probabilities) P(X|Y) from each image using Gaussian mixture model and I have state Transition

Efficiently computing element wise product of transition matrices (m*m) * (n*n) to give (mn*mn) matrix

怎甘沉沦 提交于 2019-12-07 03:32:14
问题 Consider input matrices X and Y of shapes (m,m) and (n,n) respectively. As an output we need to give a (mn,mn) shape matrix such that it multiplies corresponding entries in the two matrices. These two matrices X and Y represent transition matrices. A following example can be taken to illustrate the required output. Here, X is a 3*3 matrix and Y is a 2*2 matrix. Matrix X -------------- x1 x2 x3 x1| a b c x2| d e f x3| g h i Matrix Y -------------- y1 y2 y1| j k y2| l m Matrix Z (Output) ------

Import error ghmm library

久未见 提交于 2019-12-06 07:41:17
问题 i get this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.6/dist-packages/ghmm.py", line 112, in <module> import ghmmwrapper File "/usr/local/lib/python2.6/dist-packages/ghmmwrapper.py", line 25, in <module> _ghmmwrapper = swig_import_helper() File "/usr/local/lib/python2.6/dist-packages/ghmmwrapper.py", line 21, in swig_import_helper _mod = imp.load_module('_ghmmwrapper', fp, pathname, description) ImportError: libghmm.so.1: cannot

Getting the next observation from a HMM gaussian mixture distribution

為{幸葍}努か 提交于 2019-12-05 22:50:58
I have a continuous univariate xts object of length 1000, which I have converted into a data.frame called x to be used by the package RHmm . I have already chosen that there are going to be 5 states and 4 gaussian distributions in the mixed distribution. What I'm after is the expected mean value for the next observation. How do I go about getting that? So what I have so far is: a transition matrix from running the HMMFit() function a set of means and variances for each of the gaussian distributions in the mixture, along with their respective proportions, all of which was also generated form

How to use machine learning to calculate a graph of states from a sequence of data?

六眼飞鱼酱① 提交于 2019-12-05 20:02:53
Generic formulation I have a dataset consisting of a sequence of points with 12 features each. I am interested in detecting an event in this data. In the training data I know the moments the event occurred. When the event occurs I can see an observable pattern in the sequence of points before the event. The pattern is formed from about 300 consecutive points. I am interested in detecting when the event occurred in a infinite sequence of points. The analysis happens post factum. I am not interested in predicting if the event will occur. Concrete example You may skip this section I am building a

PyMC: Parameter estimation in a Markov system

心已入冬 提交于 2019-12-05 14:32:31
A Simple Markow Chain Let's say we want to estimate parameters of a system such that we can predict the state of the system at timestep t+1 given the state at timestep t. PyMC should be able to deal with this easily. Let our toy system consist of a moving object in a 1D world. The state is the position of the object. We want to estimate the latent variable/the speed of the object. The next state depends on the previous state and the latent variable the speed. # define the system and the data true_vel = .2 true_pos = 0 true_positions = [.2 * step for step in range(100)] We assume that we have

HMM for image sequence classification in OpenCV C++

筅森魡賤 提交于 2019-12-05 11:35:23
I am trying to classify 9 types of crops (Y) from 5 satellite images (X), acquired at dates t = {t1,...,t5}, corresponding to 5 crop phrenology states (S) i.e. preparation, seeding, growing, harvesting and post-harvesting stages. I am using similar training parcels throughout therefore the prior probabilities (initial probabilities) are equal. I have computed the likelihood model (Emission Probabilities) P(X|Y) from each image using Gaussian mixture model and I have state Transition probabilities for each crop. My question is how do I integrate this into HMM using this library to determine the

Efficiently computing element wise product of transition matrices (m*m) * (n*n) to give (mn*mn) matrix

人走茶凉 提交于 2019-12-05 06:30:57
Consider input matrices X and Y of shapes (m,m) and (n,n) respectively. As an output we need to give a (mn,mn) shape matrix such that it multiplies corresponding entries in the two matrices. These two matrices X and Y represent transition matrices. A following example can be taken to illustrate the required output. Here, X is a 3*3 matrix and Y is a 2*2 matrix. Matrix X -------------- x1 x2 x3 x1| a b c x2| d e f x3| g h i Matrix Y -------------- y1 y2 y1| j k y2| l m Matrix Z (Output) ---------------------------------------- x1y1 x1y2 x2y1 x2y2 x3y1 x3y2 x1y1| aj ak bj bk cj ck x1y2| al am bl

Problems with a hidden Markov model in PyMC3

不羁的心 提交于 2019-12-05 04:13:39
To learn PyMC, I'm trying to do a simple Hidden Markov Model as shown below: with pymc3.Model() as hmm: # Transition "matrix" a_t = np.ones(num_states) T = [pymc3.Dirichlet('T{0}'.format(i), a = a_t, shape = num_states) for i in xrange(num_states)] # Emission "matrix" a_e = np.ones(num_emissions) E = [pymc3.Dirichlet('E{0}'.format(i), a = a_e, shape = num_emissions) for i in xrange(num_states)] # State models p0 = np.ones(num_states) / num_states # No shape, so each state is a scalar tensor states = [pymc3.Categorical('s0', p = p0)] emissions = [pymc3.Categorical('z0', p = ifelse(eq(states[0],

Simple speech recognition from scratch

本秂侑毒 提交于 2019-12-04 19:37:45
The most alike question I found related to my question is this ( simple speech recognition methods ) but since had passed 3 years and the answers are not enough I will ask. I want to compute, from scratch, a simple speech recognition system, I only need to recognize five words. As much as I know, the more used audio features for this application are the MFCC, and HMM for classification. I'm able to extract the MFCC from audio but I still have some doubts about how to use the features for generating a model with HMM and then perform classification. As I understand, I have to perform vector