CGaussianShortRealKernel Class Reference


Detailed Description

The well known Gaussian kernel (swiss army knife for SVMs) on dense short-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 29 of file GaussianShortRealKernel.h.

Inheritance diagram for CGaussianShortRealKernel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CGaussianShortRealKernel (int32_t size, float64_t width)
 CGaussianShortRealKernel (CSimpleFeatures< float32_t > *l, CSimpleFeatures< float32_t > *r, float64_t width, int32_t size=10)
virtual ~CGaussianShortRealKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual bool load_init (FILE *src)
virtual bool save_init (FILE *dest)
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

Constructor & Destructor Documentation

CGaussianShortRealKernel::CGaussianShortRealKernel ( int32_t  size,
float64_t  width 
)

constructor

Parameters:
size cache size
width width

Definition at line 17 of file GaussianShortRealKernel.cpp.

CGaussianShortRealKernel::CGaussianShortRealKernel ( CSimpleFeatures< float32_t > *  l,
CSimpleFeatures< float32_t > *  r,
float64_t  width,
int32_t  size = 10 
)

constructor

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

Definition at line 22 of file GaussianShortRealKernel.cpp.

CGaussianShortRealKernel::~CGaussianShortRealKernel (  )  [virtual]

Definition at line 29 of file GaussianShortRealKernel.cpp.


Member Function Documentation

float64_t CGaussianShortRealKernel::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 49 of file GaussianShortRealKernel.cpp.

virtual EKernelType CGaussianShortRealKernel::get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type GAUSSIAN

Implements CKernel.

Definition at line 77 of file GaussianShortRealKernel.h.

virtual const char* CGaussianShortRealKernel::get_name (  )  const [virtual]

return the kernel's name

Returns:
name GaussianShortReal

Implements CSGObject.

Definition at line 83 of file GaussianShortRealKernel.h.

bool CGaussianShortRealKernel::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

Reimplemented from CSimpleKernel< float32_t >.

Definition at line 33 of file GaussianShortRealKernel.cpp.

bool CGaussianShortRealKernel::load_init ( FILE *  src  )  [virtual]

load kernel init_data

Parameters:
src file to load from
Returns:
if loading was successful

Implements CKernel.

Definition at line 39 of file GaussianShortRealKernel.cpp.

bool CGaussianShortRealKernel::save_init ( FILE *  dest  )  [virtual]

save kernel init_data

Parameters:
dest file to save to
Returns:
if saving was successful

Implements CKernel.

Definition at line 44 of file GaussianShortRealKernel.cpp.


Member Data Documentation

width

Definition at line 98 of file GaussianShortRealKernel.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation