marytts.unitselection.select
Interface TargetCostFunction

All Known Implementing Classes:
DiphoneFFRTargetCostFunction, FFRTargetCostFunction, HalfPhoneFFRTargetCostFunction

public interface TargetCostFunction

A target cost function for evaluating the goodness-of-fit of a given unit for a given target.

Author:
Marc Schröder

Method Summary
 void computeTargetFeatures(Target target)
          Compute the features for a given target, and store them in the target.
 double cost(Target target, Unit unit)
          Compute the goodness-of-fit of a given unit for a given target.
 java.lang.String getFeature(Unit unit, java.lang.String featureName)
          Get the string representation of the feature value associated with the given unit
 FeatureDefinition getFeatureDefinition()
          Provide access to the Feature Definition used.
 FeatureVector getFeatureVector(Unit unit)
          Get the target cost feature vector for the given unit.
 FeatureVector[] getFeatureVectors()
          Get all feature vectors.
 void load(FeatureFileReader featureFileReader, java.lang.String weightsFile, FeatureProcessorManager featProc)
          Initialise the data needed to do a target cost computation.
 void load(java.lang.String featureFileName, java.lang.String weightsFile, FeatureProcessorManager featProc)
          Initialise the data needed to do a target cost computation.
 

Method Detail

load

void load(java.lang.String featureFileName,
          java.lang.String weightsFile,
          FeatureProcessorManager featProc)
          throws java.io.IOException
Initialise the data needed to do a target cost computation.

Parameters:
featureFileName - name of a file containing the unit features
weightsFile - an optional weights file -- if non-null, contains feature weights that override the ones present in the feature file.
featProc - a feature processor manager which can provide feature processors to compute the features for a target at run time
Throws:
java.io.IOException

load

void load(FeatureFileReader featureFileReader,
          java.lang.String weightsFile,
          FeatureProcessorManager featProc)
          throws java.io.IOException
Initialise the data needed to do a target cost computation.

Parameters:
featureFileReader - a reader for the file containing the unit features
weightsFile - an optional weights file -- if non-null, contains feature weights that override the ones present in the feature file.
featProc - a feature processor manager which can provide feature processors to compute the features for a target at run time
Throws:
java.io.IOException

cost

double cost(Target target,
            Unit unit)
Compute the goodness-of-fit of a given unit for a given target.

Parameters:
target -
unit -
Returns:
a non-negative number; smaller values mean better fit, i.e. smaller cost.

computeTargetFeatures

void computeTargetFeatures(Target target)
Compute the features for a given target, and store them in the target.

Parameters:
target - the target for which to compute the features
See Also:
Target.getFeatureVector()

getFeatureDefinition

FeatureDefinition getFeatureDefinition()
Provide access to the Feature Definition used.

Returns:
the feature definition object.

getFeature

java.lang.String getFeature(Unit unit,
                            java.lang.String featureName)
Get the string representation of the feature value associated with the given unit

Parameters:
unit - the unit whose feature value is requested
featureName - name of the feature requested
Returns:
a string representation of the feature value
Throws:
java.lang.IllegalArgumentException - if featureName is not a known feature

getFeatureVector

FeatureVector getFeatureVector(Unit unit)
Get the target cost feature vector for the given unit.

Parameters:
unit -
Returns:

getFeatureVectors

FeatureVector[] getFeatureVectors()
Get all feature vectors. This is useful for more efficient access.

Returns:
the full array of feature vectors, or null if this method is not supported.