adlawren / jahmm

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

NaN ????? #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello all,

My Observation sequences  can be read from a file, I have 501 observations such 
as the length of  the longest sequence is 9 

My initial HMM is as follows:

static Hmm<ObservationInteger > buildInitHmm()
    {   

        Hmm <ObservationInteger > hmm = new Hmm <ObservationInteger >(9,new OpdfIntegerFactory (9));

        hmm.setPi (0, 1);
        hmm.setPi (1, 0);
        hmm.setPi (2, 0);
        hmm.setPi (3, 0);
        hmm.setPi (4, 0);
        hmm.setPi (5, 0);
        hmm.setPi (6, 0);
        hmm.setPi (7, 0);
        hmm.setPi (8, 0);

        hmm.setOpdf (0, new OpdfInteger (new double [] {17.68,57.26,0.0,10.74,0.0,13.52,0.0,0.0,0.20,0.0,0.40,0.0,0.20,0.0,0.0}));
        hmm.setOpdf (1, new OpdfInteger (new double [] {24,27.98,0.20,6.35,0.0,8.14,0.0,25.80,5.15,0.0,0.40,0.20,1.78,0.0,0.0}));
        hmm.setOpdf (2, new OpdfInteger (new double [] {21.76,26.99,0.0,10.25,1.26,11.93,0.84,12.97,10.65,0.0,0.84,0.21,2.30,0.0,0.0}));
        hmm.setOpdf (3, new OpdfInteger (new double [] {28.57,21.82,2.08,19.48,3.64,9.87,1.30,9.35,2.59,0.0,0.78,0.0,0.52,0.0,0.0}));
        hmm.setOpdf (4, new OpdfInteger (new double [] {38.37,15.87,2.58,14.76,2.21,12.92,1.11,10.70,0.37,0.0,0.0,0.37,0.74,0.0,0.0}));
        hmm.setOpdf (5, new OpdfInteger (new double [] {22.87,25.71,1.14,12,0.57,16.57,0.57,20,0.57,0.0,0.0,0.0,0.0,0.0,0.0}));
        hmm.setOpdf (6, new OpdfInteger (new double [] {33.79,25.35,1.41,8.45,0.0,15.49,0.0,15.49,0.0,0.0,0.0,0.0,0.0,0.0,0.0}));
        hmm.setOpdf (7, new OpdfInteger (new double [] {10.71,50,0.0,3.57,0.0,17.86,0.0,17.86,0.0,0.0,0.0,0.0,0.0,0.0,0.0}));
        hmm.setOpdf (8, new OpdfInteger (new double [] 
{0,50,0.0,0.0,0.0,0.0,0.0,50,0.0,0.0,0.0,0.0,0.0,0.0,0.0}));

        hmm.setAij (0, 1, 0.5);
        hmm.setAij (0, 0, 0.5);
        hmm.setAij (1, 2, 0.5);
        hmm.setAij (1, 1, 0.5);
        hmm.setAij (2, 3, 0.5);
        hmm.setAij (2, 2, 0.5);
        hmm.setAij (3, 4, 0.5);
        hmm.setAij (3, 3, 0.5);
        hmm.setAij (4, 5, 0.5);
        hmm.setAij (4, 4, 0.5);
        hmm.setAij (5, 6, 0.5);
        hmm.setAij (5, 5, 0.5);
        hmm.setAij (6, 7, 0.5);
        hmm.setAij (6, 6, 0.5);
        hmm.setAij (7, 8, 0.5);
        hmm.setAij (7, 7, 0.5);
        hmm.setAij (8, 8, 1);

        return hmm;
    }

After having introduced these parameters to "BaumWelchLearner", the system 
generates a new HMM  or all states have the following values:

State 0
   Pi: NaN
   Aij:? ? ? ? ? ? ? ? ?
   Opdf: Integer distribution --- 0? ? ? ? ? ? ? ? ? 0 0 0 0 0

Please tell me the cause of this problem and help me to correct it.

Original issue reported on code.google.com by marwa.ch...@gmail.com on 20 Nov 2012 at 1:37

GoogleCodeExporter commented 9 years ago
I have come across this library and it is really great except this case.
I am working on a fix right now, that should hopefully work as intended.

If you still need the fix, I can send it to you.

Anyway: Is this project still active?
@Projectowner: Do you want the fix?

Original comment by tikl...@gmail.com on 8 May 2013 at 1:30

GoogleCodeExporter commented 9 years ago
I'd like to have fix for this if You like to share.

Original comment by coft....@gmail.com on 1 Aug 2013 at 10:45

GoogleCodeExporter commented 9 years ago
Hi, 

If you have a fix for this problem, please email that to meat 
husnain.virk@gmail.com

BR;

Hasnain

Original comment by husnain....@gmail.com on 13 Aug 2013 at 2:34

GoogleCodeExporter commented 9 years ago
Hello,

I have this problem for few days too. Would you please share your solution with 
me as well if you do not mind? 

Basically, if I generate observations by "generateSequences" then 
BaumWelchLearner works; otherwise it does not work and gives me the same error!

I truly appreciate your help.

Best, 
Hamed

Original comment by Hamed.Ya...@gmail.com on 24 Nov 2013 at 11:22

GoogleCodeExporter commented 9 years ago
Hello,

I have this problem for few days too. Would you please share your solution with 
me as well if you do not mind? 

hamed.yaghoubi.shahir@gmail.com

Basically, if I generate observations by "generateSequences" then 
BaumWelchLearner works; otherwise it does not work and gives me the same error!

I truly appreciate your help.

Best, 
Hamed

Original comment by Hamed.Ya...@gmail.com on 24 Nov 2013 at 11:24

GoogleCodeExporter commented 9 years ago
hello,
I have a problem 

I use setOpdf to Initial the Opdf parameters, but if I set like 0.0011 the 
corresponding parameter only be 0.001,I mean the Opdf can not be smaller than 
0.001,do you know why I appreciate your help!

Original comment by rclong...@gmail.com on 25 Nov 2013 at 3:02

GoogleCodeExporter commented 9 years ago
hello,
I have a problem 

I use setOpdf to Initial the Opdf parameters, but if I set like 0.0011 the 
corresponding parameter only be 0.001,I mean the Opdf can not be smaller than 
0.001,do you know why I appreciate your help!

Original comment by rclong...@gmail.com on 25 Nov 2013 at 3:02

GoogleCodeExporter commented 9 years ago
Hello, I have the same problem as well, please email me the fix if you can at 
chris.mitropoulos@gmail.com

Original comment by chris.mi...@gmail.com on 25 Jul 2014 at 3:00

GoogleCodeExporter commented 9 years ago
Hello, I have been struggling with this problem , can you please email me the 
fix - babynigel@gmail.com

Original comment by davidokh...@gmail.com on 14 Oct 2014 at 8:58