Sautrela

edu.gtts.sautrela.wfsa.models
Class GaussianMixture

java.lang.Object
  extended by edu.gtts.sautrela.wfsa.models.GaussianMixture

public class GaussianMixture
extends java.lang.Object

Author:
mpenagar

Constructor Summary
GaussianMixture(org.xml.sax.InputSource is)
          Creates a GaussianMixture using an XML description found via an InputSource
GaussianMixture(java.lang.String name, boolean trainWeigth, boolean trainMean, boolean trainVar, boolean splitIfOrphan)
          Creates a new instance of GaussianSet
 
Method Summary
 void add(Gaussian g, double w)
           
 void addFastTrain(double[] x)
           
 void addTrain(double[] x)
           
 void addTrain(double[] x, double count)
           
 double[] addTrainGamma(double[] x)
           
 double[] addTrainGamma(double[] x, double count)
           
 GaussianMixture clone()
          Returns a copy of this GaussianMixture.
 double dumpTrain()
           
 double dumpTrain(GaussianMixture[] clones)
           
 Gaussian get(int i)
           
 java.lang.String getName()
           
 double getProb(double[] x)
           
 double[] getRandomData()
           
 double getWeight(int i)
           
 void initTrain(double initCount)
           
 void initTrain(double initCount, int topN)
           
 boolean isSplitIfOrphan()
           
 boolean isTrainMean()
           
 boolean isTrainVar()
           
 boolean isTrainWeigth()
           
static void main(java.lang.String[] args)
          GaussianMixture - create/resize/modify GMMs.
 void remove()
          Remove the lowest weight gaussian
 void remove(int i)
           
 void resize(int newSize, int newDim)
          Resize the Gaussians number and dimension.
 void setSplitIfOrphan(boolean flag)
           
 void setTrainMean(boolean flag)
           
 void setTrainVar(boolean flag)
           
 void setTrainWeigth(boolean flag)
           
 int size()
           
 void split()
          Split the highest weight gaussian
 java.lang.String toXML()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaussianMixture

public GaussianMixture(java.lang.String name,
                       boolean trainWeigth,
                       boolean trainMean,
                       boolean trainVar,
                       boolean splitIfOrphan)
Creates a new instance of GaussianSet


GaussianMixture

public GaussianMixture(org.xml.sax.InputSource is)
                throws javax.xml.parsers.ParserConfigurationException,
                       org.xml.sax.SAXException,
                       java.io.IOException
Creates a GaussianMixture using an XML description found via an InputSource

Parameters:
is - the InputSource used to locate the XML description
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
Method Detail

add

public void add(Gaussian g,
                double w)

remove

public void remove(int i)

get

public Gaussian get(int i)

getWeight

public double getWeight(int i)

size

public int size()

getName

public java.lang.String getName()

isTrainWeigth

public boolean isTrainWeigth()

setTrainWeigth

public void setTrainWeigth(boolean flag)

isSplitIfOrphan

public boolean isSplitIfOrphan()

setSplitIfOrphan

public void setSplitIfOrphan(boolean flag)

isTrainMean

public boolean isTrainMean()

setTrainMean

public void setTrainMean(boolean flag)

isTrainVar

public boolean isTrainVar()

setTrainVar

public void setTrainVar(boolean flag)

clone

public GaussianMixture clone()
Returns a copy of this GaussianMixture.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this GaussianMixture

split

public void split()
Split the highest weight gaussian


remove

public void remove()
Remove the lowest weight gaussian


resize

public void resize(int newSize,
                   int newDim)
Resize the Gaussians number and dimension.

Parameters:
newSize - new number of gaussians, or 0 for no resize
newDim - new dimension of gaussians, or 0 for no resize

getProb

public double getProb(double[] x)

getRandomData

public double[] getRandomData()

initTrain

public void initTrain(double initCount)

initTrain

public void initTrain(double initCount,
                      int topN)

addTrain

public void addTrain(double[] x)

addTrainGamma

public double[] addTrainGamma(double[] x)

addTrain

public void addTrain(double[] x,
                     double count)

addTrainGamma

public double[] addTrainGamma(double[] x,
                              double count)

addFastTrain

public void addFastTrain(double[] x)

dumpTrain

public double dumpTrain()

dumpTrain

public double dumpTrain(GaussianMixture[] clones)

toXML

public java.lang.String toXML()

main

public static void main(java.lang.String[] args)
GaussianMixture - create/resize/modify GMMs.
      Syntax:  GaussianMixture [-sSmMvVwW] [-n name] [-N gNum] [-D gDim] [URL]
 
        -s  Turn off high weigth gaussian spliting and discard orphans.
        -S  Turn on high weigth gaussian spliting and discard orphans.
        -m  Turn off means training.
        -M  Turn on means training.
        -v  Turn off variances training.
        -V  Turn on variances training.
        -w  Turn off weigths training.
        -W  Turn on weigths training.
        -n name  New name for the GMM
        -N gNum  Number of Gaussians
        -D gDim  Dimension of Gaussians
        URL  Locator of an existing GMM
 

Parameters:
args - Command line arguments.

Sautrela