Hidden Markov Model with Multivariate Mixture Emission distribution function

87 views
Skip to first unread message

Omar Amin

unread,
Sep 1, 2015, 9:20:40 AM9/1/15
to Accord.NET Framework
Hello Cesar,


I hope this message finds you well, I'm trying to use hidden markov models with gaussian mixture distribution with two multivariate normal distribution, but when i try learning i've an error in the teacher.run method which updates the hidden markov model.

Here's a snippet of the code i'm using, the error is -> An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll

details of the error -> The model fitting algorithm does not currently support different weights when the logarithm option is enabled. To avoid this exception, pass 'null' as the second parameter's value when calling this method.
at Accord.Statistics.Distributions.Multivariate.MultivariateMixture`1.Fit(Double[][] observations, Double[] weights, MixtureOptions options)
   at Accord.Statistics.Distributions.Multivariate.MultivariateMixture`1.Fit(Double[][] observations, Double[] weights, IFittingOptions options)
   at Accord.Statistics.Distributions.Multivariate.MultivariateContinuousDistribution.Accord.Statistics.Distributions.IDistribution.Fit(Array observations, Double[] weights, IFittingOptions options)
   at Accord.Statistics.Models.Markov.Learning.BaumWelchLearning`1.UpdateEmissions()
   at Accord.Statistics.Models.Markov.Learning.BaseBaumWelchLearning.run(Array[] observations)
   at Accord.Statistics.Models.Markov.Learning.BaseBaumWelchLearning.Run(Array[] observations)
   at Accord.Statistics.Models.Markov.Learning.BaumWelchLearning`1.Run(Array[] observations)
   at Accord.Statistics.Models.Markov.Learning.BaseHiddenMarkovClassifierLearning`2.<>c__DisplayClass2`1.<Run>b__0(Int32 i)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass9`1.<ForWorker>b__11()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)




Thanks in advance,
Omar

Omar Amin

unread,
Sep 1, 2015, 10:02:54 AM9/1/15
to Accord.NET Framework
Thank you,


I managed to solve the problem, i disabled the logarithmic and added the regularization to the normal options

                    Tolerance = tolerance, // local variable
                    Iterations = iterations,  // local variable
                    FittingOptions = new MixtureOptions()
                    {
                        InnerOptions = new NormalOptions()
                        {
                            Diagonal = false,
                            Regularization = 1e-10  // to prevent the error of -ve definite
                        },
                        Logarithm = false,
                        Threshold = 1e-5
                    }
Reply all
Reply to author
Forward
0 new messages