Public Member Functions | Protected Member Functions | Protected Attributes

CPolyKernel Class Reference


Detailed Description

Computes the standard polynomial kernel on CDotFeatures.

Formally, it computes

\[ k({\bf x},{\bf x'})= ({\bf x}\cdot {\bf x'}+c)^d \]

Note that additional normalisation is applied, i.e.

\[ k'({\bf x}, {\bf x'})=\frac{k({\bf x}, {\bf x'})}{\sqrt{k({\bf x}, {\bf x})k({\bf x'}, {\bf x'})}} \]

Definition at line 36 of file PolyKernel.h.

Inheritance diagram for CPolyKernel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPolyKernel ()
 CPolyKernel (CDotFeatures *l, CDotFeatures *r, int32_t d, bool inhom, int32_t size=10)
 CPolyKernel (int32_t size, int32_t degree, bool inhomogene=true)
virtual ~CPolyKernel ()
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

int32_t degree
bool inhomogene

Constructor & Destructor Documentation

CPolyKernel ( void   ) 

default constructor

Definition at line 21 of file PolyKernel.cpp.

CPolyKernel ( CDotFeatures l,
CDotFeatures r,
int32_t  d,
bool  inhom,
int32_t  size = 10 
)

constructor

Parameters:
l features of left-hand side
r features of right-hand side
d degree
inhom is inhomogeneous
size cache size

Definition at line 37 of file PolyKernel.cpp.

CPolyKernel ( int32_t  size,
int32_t  degree,
bool  inhomogene = true 
)

constructor

Parameters:
size cache size
degree degree
inhomogene is inhomogeneous

Definition at line 29 of file PolyKernel.cpp.

~CPolyKernel (  )  [virtual]

Definition at line 47 of file PolyKernel.cpp.


Member Function Documentation

void cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 58 of file PolyKernel.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

Reimplemented from CDotKernel.

Definition at line 63 of file PolyKernel.cpp.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type POLY

Implements CDotKernel.

Definition at line 78 of file PolyKernel.h.

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

return the kernel's name

Returns:
name Poly

Reimplemented from CDotKernel.

Definition at line 84 of file PolyKernel.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 CDotKernel.

Definition at line 52 of file PolyKernel.cpp.


Member Data Documentation

int32_t degree [protected]

degree

Definition at line 102 of file PolyKernel.h.

bool inhomogene [protected]

if kernel is inhomogeneous

Definition at line 104 of file PolyKernel.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