Popolon
unread,Jul 9, 2011, 5:33:43 AM7/9/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jahmm HMM library
Hi, first of all I wanted to thank you for this package, since it is
quite awesome.
However, recently I've been having an issue with the
KullbackLeiblerDistanceCalculator. It is returning null, and I can't
understand why.
I have two lists of observations:
list1:
[0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 3, 3, 1, 3, 3,
1, 3]
[3, 3, 1, 3, 3, 1, 3, 3, 1, 4, 4, 1, 4, 4, 1, 4, 4, 1, 4, 0, 1, 0, 0,
1, 0, 0]
[2, 2, 1, 2, 0, 1, 4, 4, 1, 4, 4, 1, 4, 4, 1, 0, 0, 1, 0, 0, 1, 0]
[0, 0, 1, 0, 2, 1, 3, 3, 1, 2, 2, 1, 2, 0, 1, 0, 0, 1, 0, 0, 1, 0, 4,
1, 4, 4, 1, 4, 4, 1, 4, 4, 1, 3]
[2, 2, 1, 2, 0, 1, 4, 4, 1, 4, 0, 1, 0, 0, 1, 0, 0, 1, 4, 4, 1, 4]
list2:
[2, 2, 2, 2, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 2, 0, 4, 0, 2, 0, 4,
0, 2, 2, 2, 2, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4]
[4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 2, 2, 2, 2, 2, 3, 4, 3, 2, 3, 4, 3, 2,
3, 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 2, 2, 2, 2, 2]
[2, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2,
2, 0, 4, 4, 4, 4, 4, 4, 4]
[2, 2, 2, 2, 0, 4, 4, 4, 4, 0, 2, 0, 4, 0, 2, 3, 4, 3, 2, 3, 4, 4, 4,
4, 0, 0, 0, 0, 0, 2, 2, 0, 4, 4, 2, 2, 2, 2, 2, 2, 2, 3]
[2, 2, 2, 2, 0, 4, 4, 4, 4, 0, 2, 0, 4, 0, 2, 0, 4, 0, 2, 2, 2, 2, 0,
4, 4, 4, 4, 4, 4, 4, 3]
And I learn two HMMs with 5 hidden states each in the following way:
Hmm<ObservationInteger> hmm1 = new Hmm<ObservationInteger>(nStates,new
OpdfIntegerFactory(action_table.size()));
Hmm<ObservationInteger> hmm2 = new Hmm<ObservationInteger>(nStates,new
OpdfIntegerFactory(action_table.size()));
BaumWelchLearner bwl = new BaumWelchLearner();
for (int i = 0; i < 10; i++) {
hmm1 = bwl.iterate(hmm1, lo1);
hmm2 = bwl.iterate(hmm2, lo2);
}
Then when I try to compute their distance, this call
"klc.distance(hmm2,hmm1)" returns a proper number, but this call
"klc.distance(hmm1,hmm2)", returns NaN. I've been trying to trace the
problem back, but it's a bit hard, since the computations take many
steps. I was wondering if any one has found this issue, and if you had
any tips.
Thanks a lot!
santi