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 (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 |
Protected Member Functions | |
virtual float64_t | compute (int32_t idx_a, int32_t idx_b) |
Protected Attributes | |
float64_t | width |
CGaussianMatchStringKernel | ( | int32_t | size, | |
float64_t | width | |||
) |
constructor
size | cache size | |
width | width |
Definition at line 20 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 26 of file GaussianMatchStringKernel.cpp.
~CGaussianMatchStringKernel | ( | ) | [virtual] |
Definition at line 34 of file GaussianMatchStringKernel.cpp.
void cleanup | ( | ) | [virtual] |
clean up kernel
Reimplemented from CKernel.
Definition at line 45 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 50 of file GaussianMatchStringKernel.cpp.
virtual EKernelType get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Implements CKernel.
Definition at line 71 of file GaussianMatchStringKernel.h.
virtual const char* get_name | ( | ) | const [virtual] |
return the kernel's name
Implements CSGObject.
Definition at line 80 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 39 of file GaussianMatchStringKernel.cpp.
width
Definition at line 95 of file GaussianMatchStringKernel.h.