Public Member Functions | Protected Member Functions | Protected Attributes

CSparseGaussianKernel Class Reference


Detailed Description

The well known Gaussian kernel (swiss army knife for SVMs) on sparse real valued features.

It is computed as

\[ k({\bf x},{\bf x'})= exp(-\frac{||{\bf x}-{\bf x'}||^2}{\tau}) \]

where $\tau$ is the kernel width.

Definition at line 32 of file SparseGaussianKernel.h.

Inheritance diagram for CSparseGaussianKernel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CSparseGaussianKernel (int32_t size, float64_t width)
 CSparseGaussianKernel (CSparseFeatures< float64_t > *l, CSparseFeatures< float64_t > *r, float64_t width)
virtual ~CSparseGaussianKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual EFeatureType get_feature_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
float64_tsq_lhs
float64_tsq_rhs

Constructor & Destructor Documentation

CSparseGaussianKernel ( int32_t  size,
float64_t  width 
)

constructor

Parameters:
size cache size
width width

Definition at line 19 of file SparseGaussianKernel.cpp.

constructor

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

Definition at line 24 of file SparseGaussianKernel.cpp.

~CSparseGaussianKernel (  )  [virtual]

Definition at line 31 of file SparseGaussianKernel.cpp.


Member Function Documentation

void cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 56 of file SparseGaussianKernel.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

Parameters:
idx_a index a
idx_b index b
Returns:
computed kernel function at indices a,b

Implements CKernel.

Definition at line 68 of file SparseGaussianKernel.cpp.

virtual EFeatureType get_feature_type (  )  [virtual]

return feature type the kernel can deal with

Returns:
feature type DREAL

Reimplemented from CSparseKernel< float64_t >.

Definition at line 75 of file SparseGaussianKernel.h.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type SPARSEGAUSSIAN

Implements CKernel.

Definition at line 69 of file SparseGaussianKernel.h.

virtual const char* get_name (  )  const [virtual]

return the kernel's name

Returns:
name SparseGaussian

Implements CSGObject.

Definition at line 81 of file SparseGaussianKernel.h.

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

initialize kernel

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

free sq_{r,l}hs first

Reimplemented from CSparseKernel< float64_t >.

Definition at line 36 of file SparseGaussianKernel.cpp.


Member Data Documentation

float64_t* sq_lhs [protected]

squared left-hand side

Definition at line 98 of file SparseGaussianKernel.h.

float64_t* sq_rhs [protected]

squared right-hand side

Definition at line 100 of file SparseGaussianKernel.h.

float64_t width [protected]

width

Definition at line 96 of file SparseGaussianKernel.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