public class SoftDTWModel extends Object implements AlignmentDerivativeAlgorithm
Constructor and Description |
---|
SoftDTWModel(AlignmentSpecification specificaton,
Sequence x,
Sequence y,
double[][] similarityMatrix) |
Modifier and Type | Method and Description |
---|---|
static double |
calc_weighted_comp_sum(Comparator[] comparators,
double[] weights,
int[] originalIndices,
Node nodeX,
Node nodeY)
Returns weighted sum k of local comparators: k = sum(w_i * k_i) with:
k_i: local comparators w_i: local weights
Note: Comparators, weights, originalIndices are supposed to originate
from the same AlignmentSpecification.
|
<X extends Value,Y> |
calculateParameterDerivative(DerivableComparator<X,Y> comp,
String keyword)
This returns the derivatives for all parameters of the given comparator
according to the implementation.
|
<X extends Value,Y> |
calculateRawParameterDerivative(DerivableComparator<X,Y> comp,
String keyword)
This returns the derivatives for all parameters of the given comparator
according to the implementation.
|
double[] |
calculateWeightDerivative()
Calculates the derivative for each keyword weight.
|
double[][] |
getSimilarityMatrix()
This is the dynamic programming matrix calculated by a
DynamicTimeWarpingAlgorithm.
|
double |
getSimilarityScore()
Returns the softDTW score between the two input sequences.
|
AlignmentSpecification |
getSpecificaton()
Returns the AlignmentSpecification that was basis for this Alignment.
|
Sequence |
getX()
Returns the first input sequence.
|
Sequence |
getY()
Returns the second input sequence.
|
public SoftDTWModel(AlignmentSpecification specificaton, Sequence x, Sequence y, double[][] similarityMatrix)
public Sequence getX()
public Sequence getY()
public AlignmentSpecification getSpecificaton()
public double[][] getSimilarityMatrix()
public double getSimilarityScore()
public <X extends Value,Y> Y calculateParameterDerivative(DerivableComparator<X,Y> comp, String keyword)
calculateParameterDerivative
in interface AlignmentDerivativeAlgorithm
X
- the values the given comparator can compare.Y
- the result format for derivatives of the given comparator.comp
- the DerivableComparator that provides functionality to
calculate local derivatives.keyword
- the keyword for which the given comparator was used in
the Alignment.public <X extends Value,Y> double[] calculateRawParameterDerivative(DerivableComparator<X,Y> comp, String keyword)
calculateRawParameterDerivative
in interface AlignmentDerivativeAlgorithm
X
- the values the given comparator can compare.comp
- the DerivableComparator that provides functionality to
calculate local derivatives.keyword
- the keyword for which the given comparator was used in
the Alignment.public double[] calculateWeightDerivative()
calculateWeightDerivative
in interface AlignmentDerivativeAlgorithm
public static double calc_weighted_comp_sum(Comparator[] comparators, double[] weights, int[] originalIndices, Node nodeX, Node nodeY)
comparators
- local comparators k_i (from AlignmentSpecification)weights
- local weights w_i (from AlignmentSpecification)originalIndices
- indices (corresponding to comparators and weights)
to get correct node values (from AlignmentSpecification)nodeX
- first node to comparenodeY
- second node to compareCopyright (C) 2013, 2014 Benjamin Paaßen, Charlie Krüger, Georg Zentgraf, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs