Sautrela

edu.gtts.sautrela.wfsa
Class Trainer

java.lang.Object
  extended by edu.gtts.sautrela.engine.AbstractDataProcessor
      extended by edu.gtts.sautrela.wfsa.Trainer
All Implemented Interfaces:
DataProcessor, java.beans.BeanInfo, java.io.Serializable

public class Trainer
extends AbstractDataProcessor

Author:
mpenagar
See Also:
Serialized Form

Nested Class Summary
static class Trainer.Method
           
static class Trainer.TargetType
           
 
Field Summary
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
Trainer()
           
 
Method Summary
 void editBeanInfo(java.beans.BeanInfo info)
           
 double getBeam()
          Getter for property beam.
 DefaultDWFSA.InsertionMask getInsertionMask()
          Getter for property insertionMask.
 java.lang.String getInsertionSymbolName()
          Getter for property insertionSymbolName.
 double getMapCount()
          Getter for property mapCount.
 Trainer.Method getMethod()
          Getter for property method.
 java.lang.String getOutputFileName()
          Getter for property outputFileName.
 java.lang.String getSupPropertyName()
          Getter for property supPropertyName.
 java.lang.String getSupSplitRegex()
          Getter for property supSplitRegex.
 Trainer.TargetType getTargetType()
          Getter for property targetType.
 java.net.URL getTargetURL()
          Getter for property targetURL.
 int getVerbose()
          Getter for property verbose.
 boolean isFullGCPerformed()
          Getter for property GCWaited.
static void main(java.lang.String[] args)
           
static
<S extends State,Y extends Symbol,T extends Transition<S,Y>>
double
ML(WFSA<S,Y,T> wfa, java.util.Collection<java.util.List<Y>> data, Trainer.Method method, double beam, int verbose)
          Trains a WFSA using the Maximun Likelihood criteria
static
<S extends State,Y extends Symbol,T extends Transition<S,Y>>
double
ML(WFSA<S,Y,T> wfa, java.util.Collection<java.util.List<Y>> data, Trainer.Method method, double beam, int verbose, double mapCount)
          Trains a WFSA using the Maximun Likelihood criteria
 void process(Buffer in, Buffer out)
          Processes the input Data.
 void setBeam(double beam)
          Setter for property beam.
 void setFullGCPerformed(boolean fullGCPerformed)
          Setter for property fullGCPerformed.
 void setInsertionMask(DefaultDWFSA.InsertionMask mask)
          Setter for property insertionMask.
 void setInsertionSymbolName(java.lang.String name)
          Setter for property insertionSymbolName.
 void setMapCount(double mapCount)
          Setter for property mapCount.
 void setMethod(Trainer.Method method)
          Setter for property method.
 void setOutputFileName(java.lang.String fileName)
          Setter for property outputFileName.
 void setSupPropertyName(java.lang.String supPropertyName)
          Setter for property supPropertyName.
 void setSupSplitRegex(java.lang.String supSplitRegex)
          Setter for property supSplitRegex.
 void setTargetType(Trainer.TargetType type)
          Setter for property targetType.
 void setTargetURL(java.net.URL url)
          Setter for property targetURL.
 void setVerbose(int verbose)
          Setter for property verbose.
 
Methods inherited from class edu.gtts.sautrela.engine.AbstractDataProcessor
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getName, getPropertyDescriptors, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trainer

public Trainer()
Method Detail

isFullGCPerformed

public boolean isFullGCPerformed()
Getter for property GCWaited.

Returns:
Value of property GCWaited.

setFullGCPerformed

public void setFullGCPerformed(boolean fullGCPerformed)
Setter for property fullGCPerformed.

Parameters:
fullGCPerformed - New value of property fullGCPerformed.

getMethod

public Trainer.Method getMethod()
Getter for property method.

Returns:
Value of property method.

setMethod

public void setMethod(Trainer.Method method)
Setter for property method.

Parameters:
method - New value of property method.

getBeam

public double getBeam()
Getter for property beam.

Returns:
Value of property beam.

setBeam

public void setBeam(double beam)
Setter for property beam.

Parameters:
beam - New value of property beam.

getMapCount

public double getMapCount()
Getter for property mapCount.

Returns:
Value of property mapCount.

setMapCount

public void setMapCount(double mapCount)
Setter for property mapCount.

Parameters:
mapCount - New value of property mapCount.

getOutputFileName

public java.lang.String getOutputFileName()
Getter for property outputFileName.

Returns:
Value of property outputFileName.

setOutputFileName

public void setOutputFileName(java.lang.String fileName)
Setter for property outputFileName.

Parameters:
fileName - New value of property outputFileName.

getTargetURL

public java.net.URL getTargetURL()
Getter for property targetURL.

Returns:
Value of property targetURL.

setTargetURL

public void setTargetURL(java.net.URL url)
                  throws DataProcessorException
Setter for property targetURL.

Parameters:
url - New value of property targetURL.
Throws:
DataProcessorException

getTargetType

public Trainer.TargetType getTargetType()
Getter for property targetType.

Returns:
Value of property targetType.

setTargetType

public void setTargetType(Trainer.TargetType type)
                   throws DataProcessorException
Setter for property targetType.

Parameters:
type - New value of property targetType.
Throws:
DataProcessorException

getInsertionMask

public DefaultDWFSA.InsertionMask getInsertionMask()
Getter for property insertionMask.

Returns:
Value of property insertionPolicy.

setInsertionMask

public void setInsertionMask(DefaultDWFSA.InsertionMask mask)
Setter for property insertionMask.

Parameters:
mask - New value of property insertionMask.

getInsertionSymbolName

public java.lang.String getInsertionSymbolName()
Getter for property insertionSymbolName.

Returns:
Value of property insertionSymbolName.

setInsertionSymbolName

public void setInsertionSymbolName(java.lang.String name)
Setter for property insertionSymbolName.

Parameters:
name - New value of property insertionSymbolName.

getVerbose

public int getVerbose()
Getter for property verbose.

Returns:
Value of property verbose.

setVerbose

public void setVerbose(int verbose)
Setter for property verbose.

Parameters:
verbose - New value of property verbose.

getSupPropertyName

public java.lang.String getSupPropertyName()
Getter for property supPropertyName.

Returns:
Value of property supPropertyName.

setSupPropertyName

public void setSupPropertyName(java.lang.String supPropertyName)
Setter for property supPropertyName.

Parameters:
supPropertyName - New value of property supPropertyName.

getSupSplitRegex

public java.lang.String getSupSplitRegex()
Getter for property supSplitRegex.

Returns:
Value of property supSplitRegex.

setSupSplitRegex

public void setSupSplitRegex(java.lang.String supSplitRegex)
Setter for property supSplitRegex.

Parameters:
supPropertyName - New value of property supSplitRegex.

process

public void process(Buffer in,
                    Buffer out)
             throws DataProcessorException
Processes the input Data. Multidimensional input data is treated as multidimensional symbol. Thus WFSAs with single dimmension symbols must receive scalar Data sequencially, whereas multidimensional ones (like CHMM) must receive multidimensional data.

Parameters:
in - Input Buffer
out - Output Buffer
Throws:
DataProcessorException

ML

public static <S extends State,Y extends Symbol,T extends Transition<S,Y>> double ML(WFSA<S,Y,T> wfa,
                                                                                     java.util.Collection<java.util.List<Y>> data,
                                                                                     Trainer.Method method,
                                                                                     double beam,
                                                                                     int verbose)
Trains a WFSA using the Maximun Likelihood criteria

Parameters:
wfa - the WFSA to be trained
data - the Collection of Symbol List to be used as training data
method - the Method to be used for the training
beam - logBeam for pruning (<0.0 for no prunning)

ML

public static <S extends State,Y extends Symbol,T extends Transition<S,Y>> double ML(WFSA<S,Y,T> wfa,
                                                                                     java.util.Collection<java.util.List<Y>> data,
                                                                                     Trainer.Method method,
                                                                                     double beam,
                                                                                     int verbose,
                                                                                     double mapCount)
Trains a WFSA using the Maximun Likelihood criteria

Parameters:
wfa - the WFSA to be trained
data - the Collection of Symbol List to be used as training data
method - the Method to be used for the training
beam - logBeam for pruning (negative for no prunning)
mapCount - initial posterior probability count for MAP training

editBeanInfo

public void editBeanInfo(java.beans.BeanInfo info)
Overrides:
editBeanInfo in class AbstractDataProcessor

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

Sautrela