Public Member Functions | Protected Attributes

CSqrtDiagKernelNormalizer Class Reference


Detailed Description

SqrtDiagKernelNormalizer divides by the Square Root of the product of the diagonal elements.

This effectively normalizes the vectors in feature space to norm 1 (see CSqrtDiagKernelNormalizer)

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

Definition at line 29 of file SqrtDiagKernelNormalizer.h.

Inheritance diagram for CSqrtDiagKernelNormalizer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CSqrtDiagKernelNormalizer (bool use_opt_diag=false)
virtual ~CSqrtDiagKernelNormalizer ()
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)
bool alloc_and_compute_diag (CKernel *k, float64_t *&v, int32_t num)
virtual const char * get_name () const

Protected Attributes

float64_tsqrtdiag_lhs
int32_t num_sqrtdiag_lhs
float64_tsqrtdiag_rhs
int32_t num_sqrtdiag_rhs
bool use_optimized_diagonal_computation

Constructor & Destructor Documentation

CSqrtDiagKernelNormalizer ( bool  use_opt_diag = false  ) 

default constructor

Parameters:
use_opt_diag - some kernels support faster diagonal compuation via compute_diag(idx), this flag enables this

Definition at line 36 of file SqrtDiagKernelNormalizer.h.

virtual ~CSqrtDiagKernelNormalizer (  )  [virtual]

default destructor

Definition at line 51 of file SqrtDiagKernelNormalizer.h.


Member Function Documentation

bool alloc_and_compute_diag ( CKernel k,
float64_t *&  v,
int32_t  num 
)

alloc and compute the vector containing the square root of the diagonal elements of this kernel.

Definition at line 119 of file SqrtDiagKernelNormalizer.h.

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

Implements CSGObject.

Definition at line 144 of file SqrtDiagKernelNormalizer.h.

virtual bool init ( CKernel k  )  [virtual]

initialization of the normalizer

Parameters:
k kernel

Implements CKernelNormalizer.

Definition at line 59 of file SqrtDiagKernelNormalizer.h.

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

normalize the kernel value

Parameters:
value kernel value
idx_lhs index of left hand side vector
idx_rhs index of right hand side vector

Implements CKernelNormalizer.

Definition at line 89 of file SqrtDiagKernelNormalizer.h.

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

normalize only the left hand side vector

Parameters:
value value of a component of the left hand side feature vector
idx_lhs index of left hand side vector

Implements CKernelNormalizer.

Definition at line 100 of file SqrtDiagKernelNormalizer.h.

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

normalize only the right hand side vector

Parameters:
value value of a component of the right hand side feature vector
idx_rhs index of right hand side vector

Implements CKernelNormalizer.

Definition at line 109 of file SqrtDiagKernelNormalizer.h.


Member Data Documentation

int32_t num_sqrtdiag_lhs [protected]

num sqrt diagonal left-hand side

Definition at line 151 of file SqrtDiagKernelNormalizer.h.

int32_t num_sqrtdiag_rhs [protected]

num sqrt diagonal right-hand side

Definition at line 157 of file SqrtDiagKernelNormalizer.h.

float64_t* sqrtdiag_lhs [protected]

sqrt diagonal left-hand side

Definition at line 148 of file SqrtDiagKernelNormalizer.h.

float64_t* sqrtdiag_rhs [protected]

sqrt diagonal right-hand side

Definition at line 154 of file SqrtDiagKernelNormalizer.h.

f optimized diagonal computation is used

Definition at line 160 of file SqrtDiagKernelNormalizer.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