The well known Gaussian kernel (swiss army knife for SVMs) computed on CDotFeatures.
It is computed as
where is the kernel width.
Definition at line 33 of file GaussianKernel.h.
Public Member Functions | |
CGaussianKernel () | |
CGaussianKernel (int32_t size, float64_t width) | |
CGaussianKernel (CDotFeatures *l, CDotFeatures *r, float64_t width, int32_t size=10) | |
virtual | ~CGaussianKernel () |
virtual bool | init (CFeatures *l, CFeatures *r) |
virtual void | cleanup () |
virtual EKernelType | get_kernel_type () |
virtual const char * | get_name () const |
virtual float64_t | get_width (void) const |
Protected Member Functions | |
virtual float64_t | compute (int32_t idx_a, int32_t idx_b) |
virtual void | load_serializable_post (void) throw (ShogunException) |
Protected Attributes | |
float64_t | width |
float64_t * | sq_lhs |
float64_t * | sq_rhs |
CGaussianKernel | ( | ) |
default constructor
Definition at line 20 of file GaussianKernel.cpp.
CGaussianKernel | ( | int32_t | size, | |
float64_t | width | |||
) |
constructor
size | cache size | |
width | width |
Definition at line 27 of file GaussianKernel.cpp.
CGaussianKernel | ( | CDotFeatures * | l, | |
CDotFeatures * | r, | |||
float64_t | width, | |||
int32_t | size = 10 | |||
) |
constructor
l | features of left-hand side | |
r | features of right-hand side | |
width | width | |
size | cache size |
Definition at line 34 of file GaussianKernel.cpp.
~CGaussianKernel | ( | ) | [virtual] |
Definition at line 44 of file GaussianKernel.cpp.
void cleanup | ( | ) | [virtual] |
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 |
Reimplemented from CDotKernel.
Reimplemented in CGaussianShiftKernel.
Definition at line 81 of file GaussianKernel.cpp.
virtual EKernelType get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Implements CDotKernel.
Reimplemented in CGaussianShiftKernel.
Definition at line 75 of file GaussianKernel.h.
virtual const char* get_name | ( | void | ) | const [virtual] |
return the kernel's name
Reimplemented from CDotKernel.
Reimplemented in CGaussianShiftKernel.
Definition at line 81 of file GaussianKernel.h.
virtual float64_t get_width | ( | void | ) | const [virtual] |
initialize kernel
l | features of left-hand side | |
r | features of right-hand side |
free sq_{r,l}hs first
Reimplemented from CDotKernel.
Definition at line 71 of file GaussianKernel.cpp.
void load_serializable_post | ( | void | ) | throw (ShogunException) [protected, virtual] |
Can (optionally) be overridden to post-initialize some member variables which are not PARAMETER::ADD'ed. Make sure that at first the overridden method BASE_CLASS::LOAD_SERIALIZABLE_POST is called.
ShogunException | Will be thrown if an error occurres. |
Reimplemented from CKernel.
Definition at line 87 of file GaussianKernel.cpp.
squared left-hand side
Definition at line 135 of file GaussianKernel.h.
squared right-hand side
Definition at line 137 of file GaussianKernel.h.
width
Definition at line 133 of file GaussianKernel.h.