11 #ifndef _AVGDIAGKERNELNORMALIZER_H___
12 #define _AVGDIAGKERNELNORMALIZER_H___
45 SG_ADD(&
scale,
"scale",
"Scale quotient by which kernel is scaled.",
70 for (int32_t i=0; i<num; i++)
87 float64_t value, int32_t idx_lhs, int32_t idx_rhs)
98 return value/sqrt(
scale);
107 return value/sqrt(
scale);
111 virtual const char*
get_name()
const {
return "AvgDiagKernelNormalizer"; }
virtual float64_t normalize_rhs(float64_t value, int32_t idx_rhs)
virtual bool init(CKernel *k)
virtual float64_t compute(int32_t x, int32_t y)=0
virtual int32_t get_num_vec_lhs()
virtual float64_t normalize_lhs(float64_t value, int32_t idx_lhs)
virtual const char * get_name() const
float64_t scale
the constant scaling factor (avg of diagonal or user given const)
The class Kernel Normalizer defines a function to post-process kernel values.
virtual ~CAvgDiagKernelNormalizer()
CFeatures * rhs
feature vectors to occur on right hand side
virtual float64_t normalize(float64_t value, int32_t idx_lhs, int32_t idx_rhs)
all of classes and functions are contained in the shogun namespace
Normalize the kernel by either a constant or the average value of the diagonal elements (depending on...
CFeatures * lhs
feature vectors to occur on left hand side
The class Features is the base class of all feature objects.
CAvgDiagKernelNormalizer(float64_t c=0.0)