public class HalfPhoneFFRTargetCostFunction extends FFRTargetCostFunction
Modifier and Type | Class and Description |
---|---|
class |
HalfPhoneFFRTargetCostFunction.TargetCostReporter |
Modifier and Type | Field and Description |
---|---|
protected WeightFunc[] |
leftWeightFunction |
protected FeatureDefinition |
leftWeights |
protected WeightFunc[] |
rightWeightFunction |
protected FeatureDefinition |
rightWeights |
cumulWeightedCosts, debugShowCostGraph, featureDefinition, featureVectors, nCostComputations, targetFeatureComputer, weightFunction, weightsNonZero
Constructor and Description |
---|
HalfPhoneFFRTargetCostFunction() |
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
|
FeatureVector |
getUnitFeatures(Unit unit)
Look up the features for a given unit.
|
void |
load(FeatureFileReader featureFileReader,
String weightsFile,
FeatureProcessorManager featProc) |
void |
load(String featureFileName,
String weightsFile,
FeatureProcessorManager featProc)
Initialise the data needed to do a target cost computation.
|
cost, featureCost, featureCost, getFeatureDefinition, getFeatureVector, getFeatureVectors, load, load, rememberWhichWeightsAreNonZero
protected FeatureDefinition leftWeights
protected FeatureDefinition rightWeights
protected WeightFunc[] leftWeightFunction
protected WeightFunc[] rightWeightFunction
public double cost(Target target, Unit unit)
cost
in interface TargetCostFunction
cost
in class FFRTargetCostFunction
target
- targetunit
- unitpublic void load(String featureFileName, String weightsFile, FeatureProcessorManager featProc) throws IOException, MaryConfigurationException
featureFileName
- name of a file containing the unit featuresweightsFile
- an optional string containing weights file names -- if non-null, contains two file names separated by the
character '|', pointing to feature weights files for left and right units, respectively, 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
- MaryConfigurationExceptionpublic void load(FeatureFileReader featureFileReader, String weightsFile, FeatureProcessorManager featProc) throws IOException
IOException
public void computeTargetFeatures(Target target)
computeTargetFeatures
in interface TargetCostFunction
computeTargetFeatures
in class FFRTargetCostFunction
target
- the target for which to compute the featuresTarget.getFeatureVector()
public FeatureVector getUnitFeatures(Unit unit)
unit
- a unit in the databasepublic String getFeature(Unit unit, String featureName)
getFeature
in interface TargetCostFunction
getFeature
in class FFRTargetCostFunction
unit
- the unit whose feature value is requestedfeatureName
- name of the feature requestedIllegalArgumentException
- if featureName is not a known featureCopyright © 2000–2016 DFKI GmbH. All rights reserved.