Public Member Functions | Protected Member Functions | Protected Attributes

CGaussianMatchStringKernel Class Reference

Detailed Description

The class GaussianMatchStringKernel computes a variant of the Gaussian kernel on strings of same length.

It is computed as

\[ k({\bf x},{\bf x'})= e^{-\frac{\left(x-x'\right)^2}{w}} \]

Note that additional normalisation is applied, i.e.

\[ 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 34 of file GaussianMatchStringKernel.h.

Inheritance diagram for CGaussianMatchStringKernel:
Inheritance graph

List of all members.

Public Member Functions

 CGaussianMatchStringKernel ()
 CGaussianMatchStringKernel (int32_t size, float64_t width)
 CGaussianMatchStringKernel (CStringFeatures< char > *l, CStringFeatures< char > *r, float64_t width)
virtual ~CGaussianMatchStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
virtual void register_params ()

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

float64_t width

Constructor & Destructor Documentation

default constructor

Definition at line 20 of file GaussianMatchStringKernel.cpp.

CGaussianMatchStringKernel ( int32_t  size,
float64_t  width 


size cache size
width width

Definition at line 27 of file GaussianMatchStringKernel.cpp.

CGaussianMatchStringKernel ( CStringFeatures< char > *  l,
CStringFeatures< char > *  r,
float64_t  width 


l features of left-hand side
r features of right-hand side
width width

Definition at line 34 of file GaussianMatchStringKernel.cpp.

~CGaussianMatchStringKernel (  )  [virtual]

Definition at line 43 of file GaussianMatchStringKernel.cpp.

Member Function Documentation

void cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 54 of file GaussianMatchStringKernel.cpp.

float64_t compute ( int32_t  idx_a,
int32_t  idx_b 
) [protected, virtual]

compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object

idx_a index a
idx_b index b
computed kernel function at indices a,b

Implements CKernel.

Definition at line 59 of file GaussianMatchStringKernel.cpp.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

kernel type POLYMATCH

Implements CStringKernel< char >.

Definition at line 74 of file GaussianMatchStringKernel.h.

virtual const char* get_name (  )  const [virtual]

return the kernel's name

name GaussMatchStringKernel

Reimplemented from CStringKernel< char >.

Definition at line 83 of file GaussianMatchStringKernel.h.

bool init ( CFeatures l,
CFeatures r 
) [virtual]

initialize kernel

l features of left-hand side
r features of right-hand side
if initializing was successful

Reimplemented from CStringKernel< char >.

Definition at line 48 of file GaussianMatchStringKernel.cpp.

void register_params (  )  [virtual]

register the parameters

Reimplemented from CKernel.

Definition at line 82 of file GaussianMatchStringKernel.cpp.

Member Data Documentation

float64_t width [protected]


Definition at line 101 of file GaussianMatchStringKernel.h.

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

SHOGUN Machine Learning Toolbox - Documentation