HaihuaXie / jahmm

Automatically exported from code.google.com/p/jahmm
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Mixture of Multivariate Gaussians #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I want to use the class HMM to model left-right HMMs in a speech
recognition system. 
The problem is: The state pdf used in this case is a mixture of
multivariate gaussians and, as I read on JavaDocs, the Opdf interface is
not implemented this way by anyone of the classes described. 
Have someone worked on it?

Original issue reported on code.google.com by denisealves88 on 25 May 2010 at 7:42

GoogleCodeExporter commented 9 years ago
I'm not sure if i did understand you correctly, but maybe this can help you. 
Here is
a snippet how to create an HMM using OpdfMultiGaussian:

        OpdfMultiGaussianFactory factory = new OpdfMultiGaussianFactory(2);
        //factory.factor();
        Hmm<ObservationVector> hmm = new Hmm<ObservationVector>(2, factory);

        hmm.setPi(0, 0.50);
        hmm.setPi(1, 0.50);

        double [] mean = {4, 4};
        double [][] covariance = { {2, 2}, {1., 1} };
        OpdfMultiGaussian omg = new OpdfMultiGaussian (mean ,  covariance);

        // same as upper OpdfMultiGaussian, but in one line and with other values
        OpdfMultiGaussian omg2 = new OpdfMultiGaussian (new double[] {6, 6} /*mean*/ ,  new
double[][] { {4, 4}, {3., 3} } /*covariance*/);

        // set Observation Probability distribution function
        hmm.setOpdf(0, omg);
        hmm.setOpdf(1, omg2);

        hmm.setAij(0, 1, 0.2);
        hmm.setAij(0, 0, 0.8);
        hmm.setAij(1, 0, 0.2);
        hmm.setAij(1, 1, 0.8);

kind regards, 
Ben

Original comment by vamos.be...@gmail.com on 27 May 2010 at 10:00