From fbc31dc6a47c371fe1d4a6891520f0e20004095a Mon Sep 17 00:00:00 2001 From: bepo23 Date: Tue, 16 Jun 2009 09:17:57 +0000 Subject: [PATCH] Removed unneeded first scaling attempt of the HMM. Cleaned up the WiimoteStreamer to be more readable as preparation to adapt to new functions with wiimotes interaction. git-svn-id: svn://svn.code.sf.net/p/wiigee/code/trunk@92 c7eff9ee-dd40-0410-8832-91a4d88773cf --- src/org/wiigee/logic/ScaledHMM.java | 336 ---------------------------- 1 file changed, 336 deletions(-) delete mode 100644 src/org/wiigee/logic/ScaledHMM.java diff --git a/src/org/wiigee/logic/ScaledHMM.java b/src/org/wiigee/logic/ScaledHMM.java deleted file mode 100644 index 8b0deac..0000000 --- a/src/org/wiigee/logic/ScaledHMM.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * wiigee - accelerometerbased gesture recognition - * Copyright (C) 2007, 2008 Benjamin Poppinga - * - * Developed at University of Oldenburg - * Contact: benjamin.poppinga@informatik.uni-oldenburg.de - * - * This file is part of wiigee. - * - * wiigee is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.wiigee.logic; -import java.text.*; -import java.util.Vector; - -/** - * This is a Hidden Markov Model implementation which internally provides - * the basic algorithms for training and recognition (forward and backward - * algorithm). Since a regular Hidden Markov Model doesn't provide a possibility - * to train multiple sequences, this implementation has been optimized for this - * purposes using some state-of-the-art technologies described in several papers. - * - * @author Benjamin 'BePo' Poppinga - * - */ - -public class ScaledHMM { - /** The number of states */ - private int numStates; - - /** The number of observations */ - private int sigmaSize; - - /** The initial probabilities for each state: p[state] */ - public double pi[]; - - /** The state change probability to switch from state A to - * state B: a[stateA][stateB] */ - public double a[][]; - - /** The probability to emit symbol S in state A: b[stateA][symbolS] */ - public double b[][]; - - /** - * Initialize the Hidden Markov Model in a left-to-right version. - * - * @param numStates Number of states - * @param sigmaSize Number of observations - */ - public ScaledHMM(int numStates, int sigmaSize) { - this.numStates = numStates; - this.sigmaSize = sigmaSize; - pi = new double[numStates]; - a = new double[numStates][numStates]; - b = new double[numStates][sigmaSize]; - this.reset(); - } - - /** - * Reset the Hidden Markov Model to the initial left-to-right values. - * - */ - private void reset() { - int jumplimit = 2; - - // set startup probability - pi[0] = 1; - for(int i=1; ij-jumplimit-1) { - a[i][j] = 1.0/(jumplimit+1); - } else { - a[i][j] = 0.0; - } - } - } - - - // emission probability - for(int i=0; i