Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException in KMeansLearner.learn method #32

Open
GoogleCodeExporter opened this issue Jun 20, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

I'm newbie with Jahmm and I've tried to implement a HMM that recieve a list of 
sequences corresponding to a trajectory. Each value are compound for 4 
variables: x, y, and dx,xy (velocity vector).

The output states are 2: Right and Left.

I have an ArrayIndexOutOfBoundsException exception in the learn method of 
KMeansLearner:


Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 330
    at be.ac.ulg.montefiore.run.jahmm.OpdfInteger.fit(OpdfInteger.java:116)
    at be.ac.ulg.montefiore.run.jahmm.learn.KMeansLearner.learnOpdf(KMeansLearner.java:165)
    at be.ac.ulg.montefiore.run.jahmm.learn.KMeansLearner.iterate(KMeansLearner.java:67)
    at be.ac.ulg.montefiore.run.jahmm.learn.KMeansLearner.learn(KMeansLearner.java:96)
    at Detector.main(Detector.java:97)

This is the code:

int inputStates = 4;
        KMeansLearner kmeansRight = new KMeansLearner(inputStates, new OpdfIntegerFactory(inputStates), obsSequenceRight);
        Hmm derHMM = kmeansRight.learn();

        KMeansLearner kmeansLeft = new KMeansLearner(inputStates, new OpdfIntegerFactory(inputStates), obsSequenceLeft);
        Hmm izqHMM = kmeansLeft.learn();

        List<List<Integer>> lsTest = detector.leerDirectorio(filename);
        for (int i = 0; i < lsTest.size(); i++) {
            double derProb = derHMM.probability(lsTest);
            double izqProb = izqHMM.probability(lsTest);
        }

Thanks for the help.

Original issue reported on code.google.com by [email protected] on 11 Jan 2015 at 4:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant