public class DiphoneFFRTargetCostFunction extends Object implements TargetCostFunction
| Modifier and Type | Field and Description |
|---|---|
protected FFRTargetCostFunction |
tcfForHalfphones |
| Constructor and Description |
|---|
DiphoneFFRTargetCostFunction() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
String |
getFeature(Unit unit,
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 ffr,
InputStream weightsStream,
FeatureProcessorManager featProc)
Initialise the data needed to do a target cost computation.
|
void |
load(String featureFileName,
InputStream weightsStream,
FeatureProcessorManager featProc)
Initialise the data needed to do a target cost computation.
|
protected FFRTargetCostFunction tcfForHalfphones
public void load(String featureFileName, InputStream weightsStream, FeatureProcessorManager featProc) throws IOException, MaryConfigurationException
load in interface TargetCostFunctionfeatureFileName - name of a file containing the unit featuresweightsStream - 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
timeIOException - IOExceptionMaryConfigurationException - if a configuration problem is detected while loading the datapublic void load(FeatureFileReader ffr, InputStream weightsStream, FeatureProcessorManager featProc) throws IOException
TargetCostFunctionload in interface TargetCostFunctionffr - a reader for the file containing the unit featuresweightsStream - 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
timeIOException - IOExceptionpublic FeatureDefinition getFeatureDefinition()
getFeatureDefinition in interface TargetCostFunctionpublic String getFeature(Unit unit, String featureName)
getFeature in interface TargetCostFunctionunit - the unit whose feature value is requestedfeatureName - name of the feature requestedIllegalArgumentException - if featureName is not a known featurepublic FeatureVector getFeatureVector(Unit unit)
TargetCostFunctiongetFeatureVector in interface TargetCostFunctionunit - unitpublic double cost(Target target, Unit unit)
cost in interface TargetCostFunctiontarget - targetunit - unitpublic void computeTargetFeatures(Target target)
computeTargetFeatures in interface TargetCostFunctiontarget - the target for which to compute the featuresTarget.getFeatureVector()public FeatureVector[] getFeatureVectors()
TargetCostFunctiongetFeatureVectors in interface TargetCostFunctionCopyright © 2000–2016 DFKI GmbH. All rights reserved.