Public Member Functions | Protected Member Functions

CDistanceKernel Class Reference


Detailed Description

The Distance kernel takes a distance as input.

It turns a distance into something kernel like by computing

\[ k({\bf x}, {\bf x'}) = e^{-\frac{dist({\bf x}, {\bf x'})}{width}} \]

Definition at line 33 of file DistanceKernel.h.

Inheritance diagram for CDistanceKernel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CDistanceKernel (void)
 CDistanceKernel (int32_t cache, float64_t width, CDistance *dist)
 CDistanceKernel (CFeatures *l, CFeatures *r, float64_t width, CDistance *dist)
virtual ~CDistanceKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual EKernelType get_kernel_type ()
virtual EFeatureType get_feature_type ()
virtual EFeatureClass get_feature_class ()
virtual const char * get_name () const

Protected Member Functions

float64_t compute (int32_t idx_a, int32_t idx_b)

Constructor & Destructor Documentation

CDistanceKernel ( void   ) 

default constructor

Definition at line 20 of file DistanceKernel.cpp.

CDistanceKernel ( int32_t  cache,
float64_t  width,
CDistance dist 
)

constructor

Parameters:
cache cache size
width width
dist distance

Definition at line 26 of file DistanceKernel.cpp.

CDistanceKernel ( CFeatures l,
CFeatures r,
float64_t  width,
CDistance dist 
)

constructor

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

Definition at line 33 of file DistanceKernel.cpp.

~CDistanceKernel (  )  [virtual]

Definition at line 42 of file DistanceKernel.cpp.


Member Function Documentation

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 58 of file DistanceKernel.cpp.

virtual EFeatureClass get_feature_class (  )  [virtual]

return feature class the kernel can deal with

Returns:
feature class of distance used

Implements CKernel.

Definition at line 82 of file DistanceKernel.h.

virtual EFeatureType get_feature_type (  )  [virtual]

return feature type the kernel can deal with

Returns:
feature type of distance used

Implements CKernel.

Definition at line 76 of file DistanceKernel.h.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type DISTANCE

Implements CKernel.

Definition at line 71 of file DistanceKernel.h.

virtual const char* get_name ( void   )  const [virtual]

return the kernel's name

Returns:
name Distance

Implements CSGObject.

Definition at line 88 of file DistanceKernel.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

Reimplemented from CKernel.

Definition at line 50 of file DistanceKernel.cpp.


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