edu.cmu.sphinx.decoder.scorer
Class ThreadedAcousticScorer

java.lang.Object
  extended by edu.cmu.sphinx.decoder.scorer.AbstractScorer
      extended by edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer
All Implemented Interfaces:
AcousticScorer, Configurable

public class ThreadedAcousticScorer
extends AbstractScorer

An acoustic scorer that breaks the scoring up into a configurable number of separate threads.

All scores are maintained in LogMath log base


Field Summary
static java.lang.String PROP_IS_CPU_RELATIVE
          A sphinx property name that controls whether the number of available CPUs on the system is used when determining the number of threads to use for scoring.
static java.lang.String PROP_MIN_SCOREABLES_PER_THREAD
          A Sphinx Property name that controls the minimum number of scoreables sent to a thread.
static java.lang.String PROP_NUM_THREADS
          A SphinxProperty name that controls the number of threads that are used to score hmm states.
 
Fields inherited from class edu.cmu.sphinx.decoder.scorer.AbstractScorer
FEATURE_FRONTEND, SCORE_NORMALIZER
 
Constructor Summary
ThreadedAcousticScorer()
           
 
Method Summary
 void allocate()
          Allocates resources for this scorer
 void deallocate()
          Deallocates resouces for this scorer
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 
Methods inherited from class edu.cmu.sphinx.decoder.scorer.AbstractScorer
calculateScores, startRecognition, stopRecognition, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_NUM_THREADS

@S4Integer(defaultValue=0)
public static final java.lang.String PROP_NUM_THREADS
A SphinxProperty name that controls the number of threads that are used to score hmm states. If the isCpuRelative property is false, then is is the exact number of threads that are used to score hmm states. If the isCpuRelative property is true, then this value is combined with the number of available proessors on the system. If you want to have one thread per CPU available to score states, set the NUM_THREADS property to 0 and the isCpuRelative to true. If you want exactly one thread to process scores set NUM_THREADS to 1 and isCpuRelative to false.

If the value is 1 isCpuRelative is false no additional thread will be instantiated, and all compuation will be done in the calling thread itself. The default value is 0.

See Also:
Constant Field Values

PROP_IS_CPU_RELATIVE

@S4Boolean(defaultValue=true)
public static final java.lang.String PROP_IS_CPU_RELATIVE
A sphinx property name that controls whether the number of available CPUs on the system is used when determining the number of threads to use for scoring. If true, the NUM_THREADS property is combined with the available number of CPUS to deterimine the number of threads. Note that the number of threads is contrained to be never lower than zero. Also, if the number of threads is 0, the states are scored on the calling thread, no separate threads are started. The default value is false.

See Also:
Constant Field Values

PROP_MIN_SCOREABLES_PER_THREAD

@S4Integer(defaultValue=10)
public static final java.lang.String PROP_MIN_SCOREABLES_PER_THREAD
A Sphinx Property name that controls the minimum number of scoreables sent to a thread. This is used to prevent over threading of the scoring that could happen if the number of threads is high compared to the size of the activelist. The default is 50

See Also:
Constant Field Values
Constructor Detail

ThreadedAcousticScorer

public ThreadedAcousticScorer()
Method Detail

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class AbstractScorer
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

allocate

public void allocate()
Description copied from interface: AcousticScorer
Allocates resources for this scorer

Specified by:
allocate in interface AcousticScorer
Overrides:
allocate in class AbstractScorer

deallocate

public void deallocate()
Description copied from interface: AcousticScorer
Deallocates resouces for this scorer

Specified by:
deallocate in interface AcousticScorer
Overrides:
deallocate in class AbstractScorer