public class JoinModelCost extends Object implements JoinCostFunction
Modifier and Type | Field and Description |
---|---|
protected int |
nCostComputations |
Constructor and Description |
---|
JoinModelCost()
Empty constructor; when using this, call load() separately to initialise this class.
|
Modifier and Type | Method and Description |
---|---|
double |
cost(Target t1,
Unit u1,
Target t2,
Unit u2)
A combined cost computation, as a weighted sum of the signal-based cost (computed from the units) and the phonetics-based
cost (computed from the targets).
|
void |
init(String configPrefix)
Initialise this join cost function by reading the appropriate settings from the MaryProperties using the given
configPrefix.
|
void |
load(String joinFileName,
InputStream joinPdfStream,
InputStream joinTreeStream,
String trickyPhonesFile)
Load weights and values from the given file
|
void |
load(String a,
InputStream b,
String c,
float d)
Deprecated.
|
void |
setFeatureDefinition(FeatureDefinition def)
Set the feature definition to use for interpreting target feature vectors.
|
public JoinModelCost()
public void init(String configPrefix) throws MaryConfigurationException
init
in interface JoinCostFunction
configPrefix
- the prefix for the (voice-specific) config entries to use when looking up files to load.MaryConfigurationException
- MaryConfigurationException@Deprecated public void load(String a, InputStream b, String c, float d)
JoinCostFunction
load
in interface JoinCostFunction
a
- the file from which to read default weights and join cost featuresb
- an optional file from which to read weights, taking precedence overc
- an optional file containing precompiled join costsd
- Relative weight of the signal-based join costs relative to the phonetic join costs computed from the targetpublic void load(String joinFileName, InputStream joinPdfStream, InputStream joinTreeStream, String trickyPhonesFile) throws IOException, MaryConfigurationException
joinFileName
- the file from which to read join cost featuresjoinPdfStream
- the file from which to read the Gaussian models in the leaves of the treejoinTreeStream
- the file from which to read the Tree, in HTS format.trickyPhonesFile
- trickyPhonesFileIOException
- IOExceptionMaryConfigurationException
- MaryConfigurationExceptionpublic void setFeatureDefinition(FeatureDefinition def)
def
- the feature definition to use.public double cost(Target t1, Unit u1, Target t2, Unit u2)
cost
in interface JoinCostFunction
t1
- The left target.u1
- The left unit.t2
- The right target.u2
- The right unit.Copyright © 2000–2016 DFKI GmbH. All rights reserved.