#include <KernelFunctions.h>
Collaboration diagram for Impala::Core::Training::MpoChi2Kernel:
Public Member Functions | |
MpoChi2Kernel (const std::vector< double > &weights, const std::vector< double > &averages) | |
double | DoIt (const std::vector< double > &d) |
Private Attributes | |
double | mNormalisation |
std::vector< double > | mWeights |
thus, it computes K(Si, Sj) = exp(-1/A * D(Si, Sj)) with D() the chi-squared distance between vectors Si and Sj. And A is the average of all chi2 distances. If we have multiple vectors as input, we will get the following: K() = exp((1/(wS+wT+wU)) * (wS * -1/AS * D(Si, Sj) + wT * -1/AT * D(Ti, Tj) + wU * -1/AU * D(Ui, Uj))) his is for three input vectors S,T,U, with region weights specified as wS, wT, wU. Each individual component is computed as above, but with additional weighting for the region weights.
The weights and averages are passed to the constructor. The doit function assumes a vector of distances.
Note: All vectors should have equal length, the trait does not check this!
Definition at line 42 of file KernelFunctions.h.