X
- the class of the elements in the input sequences.public class LMNNGradientCalculator<X> extends Object
Constructor and Description |
---|
LMNNGradientCalculator(List<? extends List<X>> data,
int[] trainingLabels,
AlignmentAlgorithm<X,X,? extends DerivableAlignmentDistance<X,X>> algo) |
Modifier and Type | Method and Description |
---|---|
double[] |
computeGradient(DerivableComparator<X,X> comp,
double[][] D)
Calculates the gradient of the LMNN cost function with respect to the
parameters of the given comparator.
|
public LMNNGradientCalculator(@NonNull List<? extends List<X>> data, @NonNull int[] trainingLabels, @NonNull AlignmentAlgorithm<X,X,? extends DerivableAlignmentDistance<X,X>> algo)
public double[] computeGradient(@NonNull DerivableComparator<X,X> comp, @NonNull double[][] D)
comp
- the comparator itself.D
- given N training data points this should be a N x N matrix
of alignment distances computed with the same distance
scheme as is implemented by the given algorithm for this
LMNNGradientCalculator. This distance matrix serves as basis for the
determination of the LMNN cost function.Copyright (C) 2016 Benjamin Paaßen, 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 . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/