CPolyKernel Class Reference

Inheritance diagram for CPolyKernel:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPolyKernel (CRealFeatures *l, CRealFeatures *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 bool load_init (FILE *src)
virtual bool save_init (FILE *dest)
virtual EKernelType get_kernel_type ()
virtual const char * get_name ()

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

int32_t degree
bool inhomogene


Detailed Description

Computes the standard polynomial kernel on dense real valued features

\[ 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 28 of file PolyKernel.h.


Constructor & Destructor Documentation

CPolyKernel::CPolyKernel ( CRealFeatures l,
CRealFeatures 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 24 of file PolyKernel.cpp.

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

constructor

Parameters:
size cache size
degree degree
inhomogene is inhomogeneous

Definition at line 18 of file PolyKernel.cpp.

CPolyKernel::~CPolyKernel (  )  [virtual]

Definition at line 32 of file PolyKernel.cpp.


Member Function Documentation

void CPolyKernel::cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 43 of file PolyKernel.cpp.

float64_t CPolyKernel::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 PolyKernel.cpp.

virtual EKernelType CPolyKernel::get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type POLY

Implements CKernel.

Definition at line 81 of file PolyKernel.h.

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

return the kernel's name

Returns:
name Poly

Implements CKernel.

Definition at line 87 of file PolyKernel.h.

bool CPolyKernel::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< float64_t >.

Definition at line 37 of file PolyKernel.cpp.

bool CPolyKernel::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 48 of file PolyKernel.cpp.

bool CPolyKernel::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 53 of file PolyKernel.cpp.


Member Data Documentation

int32_t CPolyKernel::degree [protected]

degree

Definition at line 102 of file PolyKernel.h.

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

SHOGUN Machine Learning Toolbox - Documentation