SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Attributes
CAvgDiagKernelNormalizer Class Reference

Detailed Description

Normalize the kernel by either a constant or the average value of the diagonal elements (depending on argument c of the constructor).

In case c <= 0 compute scale as

\[ \mbox{scale} = \frac{1}{N}\sum_{i=1}^N k(x_i,x_i) \]

otherwise use scale=c and normalize the kernel via

\[ k'(x,x')= \frac{k(x,x')}{scale} \]

Definition at line 31 of file AvgDiagKernelNormalizer.h.

Inheritance diagram for CAvgDiagKernelNormalizer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CAvgDiagKernelNormalizer (float64_t c=0.0)
virtual ~CAvgDiagKernelNormalizer ()
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

Protected Attributes

float64_t scale
 the constant scaling factor (avg of diagonal or user given const)

Constructor & Destructor Documentation

constructor

Parameters:
cscale parameter, if <= 0 scaling will be computed from the avg of the kernel diagonal elements

Definition at line 39 of file AvgDiagKernelNormalizer.h.

virtual ~CAvgDiagKernelNormalizer ( ) [virtual]

default destructor

Definition at line 48 of file AvgDiagKernelNormalizer.h.


Member Function Documentation

virtual const char* get_name ( ) const [virtual]
Returns:
object name

Implements CSGObject.

Definition at line 109 of file AvgDiagKernelNormalizer.h.

virtual bool init ( CKernel k) [virtual]

initialization of the normalizer (if needed)

Parameters:
kkernel

Implements CKernelNormalizer.

Definition at line 54 of file AvgDiagKernelNormalizer.h.

virtual float64_t normalize ( float64_t  value,
int32_t  idx_lhs,
int32_t  idx_rhs 
) [virtual]

normalize the kernel value

Parameters:
valuekernel value
idx_lhsindex of left hand side vector
idx_rhsindex of right hand side vector

Implements CKernelNormalizer.

Definition at line 84 of file AvgDiagKernelNormalizer.h.

virtual float64_t normalize_lhs ( float64_t  value,
int32_t  idx_lhs 
) [virtual]

normalize only the left hand side vector

Parameters:
valuevalue of a component of the left hand side feature vector
idx_lhsindex of left hand side vector

Implements CKernelNormalizer.

Definition at line 94 of file AvgDiagKernelNormalizer.h.

virtual float64_t normalize_rhs ( float64_t  value,
int32_t  idx_rhs 
) [virtual]

normalize only the right hand side vector

Parameters:
valuevalue of a component of the right hand side feature vector
idx_rhsindex of right hand side vector

Implements CKernelNormalizer.

Definition at line 103 of file AvgDiagKernelNormalizer.h.


Member Data Documentation

float64_t scale [protected]

the constant scaling factor (avg of diagonal or user given const)

Definition at line 113 of file AvgDiagKernelNormalizer.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation