Normalize the kernel by adding a constant term to its diagonal. This aids kernels to become positive definite (even though they are not - often caused by numerical problems).
Formally,
where E is a matrix with ones on the diagonal and R is the scalar ridge term. The ridge term R is computed as .
Typically,
In case c <= 0, c is compute as the mean of the kernel diagonal
在文件RidgeKernelNormalizer.h第43行定义。
公有成员 | |
CRidgeKernelNormalizer (float64_t r=1e-10, float64_t c=0.0) | |
virtual | ~CRidgeKernelNormalizer () |
virtual bool | init (CKernel *k) |
virtual float64_t | normalize (float64_t value, int32_t idx_lhs, int32_t idx_rhs) |
virtual float64_t | normalize_lhs (float64_t value, int32_t idx_lhs) |
virtual float64_t | normalize_rhs (float64_t value, int32_t idx_rhs) |
virtual const char * | get_name () const |
保护属性 | |
float64_t | ridge |
the constant ridge to be added to the kernel diagonal | |
float64_t | scale |
scaling parameter (avg of diagonal) |
CRidgeKernelNormalizer | ( | float64_t | r = 1e-10 , |
float64_t | c = 0.0 |
||
) |
constructor
r | ridge parameter |
c | scale parameter, if <= 0 scaling will be computed from the avg of the kernel diagonal elements |
the scalar r*c will be added to the kernel diagonal, typical use cases:
在文件RidgeKernelNormalizer.h第56行定义。
virtual ~CRidgeKernelNormalizer | ( | ) | [virtual] |
default destructor
在文件RidgeKernelNormalizer.h第63行定义。
virtual const char* get_name | ( | ) | const [virtual] |
virtual bool init | ( | CKernel * | k ) | [virtual] |
normalize the kernel value
value | kernel value |
idx_lhs | index of left hand side vector |
idx_rhs | index of right hand side vector |
在文件RidgeKernelNormalizer.h第100行定义。
normalize only the left hand side vector
value | value of a component of the left hand side feature vector |
idx_lhs | index of left hand side vector |
在文件RidgeKernelNormalizer.h第113行定义。
normalize only the right hand side vector
value | value of a component of the right hand side feature vector |
idx_rhs | index of right hand side vector |
在文件RidgeKernelNormalizer.h第123行定义。
the constant ridge to be added to the kernel diagonal
在文件RidgeKernelNormalizer.h第134行定义。
scaling parameter (avg of diagonal)
在文件RidgeKernelNormalizer.h第136行定义。