The class GaussianMatchStringKernel computes a variant of the Gaussian kernel on strings of same length.
It is computed as
Note that additional normalisation is applied, i.e.
Definition at line 34 of file GaussianMatchStringKernel.h.
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 |
default constructor
Definition at line 20 of file GaussianMatchStringKernel.cpp.
CGaussianMatchStringKernel | ( | int32_t | size, | |
float64_t | width | |||
) |
constructor
size | cache size | |
width | width |
Definition at line 27 of file GaussianMatchStringKernel.cpp.
CGaussianMatchStringKernel | ( | CStringFeatures< char > * | l, | |
CStringFeatures< char > * | r, | |||
float64_t | width | |||
) |
constructor
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.
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 |
Implements CKernel.
Definition at line 59 of file GaussianMatchStringKernel.cpp.
virtual EKernelType get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Implements CStringKernel< char >.
Definition at line 74 of file GaussianMatchStringKernel.h.
virtual const char* get_name | ( | ) | const [virtual] |
return the kernel's name
Reimplemented from CStringKernel< char >.
Definition at line 83 of file GaussianMatchStringKernel.h.
initialize kernel
l | features of left-hand side | |
r | features of right-hand side |
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.
width
Definition at line 101 of file GaussianMatchStringKernel.h.