Public Member Functions | Protected Member Functions | Protected Attributes

CSparseSpatialSampleStringKernel Class Reference

Detailed Description

Sparse Spatial Sample String Kernel by Pavel Kuksa <> and Vladimir Pavlovic <>

Definition at line 30 of file SparseSpatialSampleStringKernel.h.

Inheritance diagram for CSparseSpatialSampleStringKernel:
Inheritance graph

List of all members.

Public Member Functions

 CSparseSpatialSampleStringKernel ()
 CSparseSpatialSampleStringKernel (CStringFeatures< char > *l, CStringFeatures< char > *r)
virtual ~CSparseSpatialSampleStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
void set_d (int32_t max_distance)
int32_t get_d ()
void set_t (int32_t sequence_length)
int32_t get_t ()
virtual const char * get_name () const

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)
SSKFeaturesextractTriple (int **S, int *len, int nStr, int d1, int d2)
SSKFeaturesextractDouble (int **S, int *len, int nStr, int d1)
void compute_double (int32_t idx_a, int32_t idx_b)
void compute_triple (int32_t idx_a, int32_t idx_b)
int * cntsrtna (int *sx, int k, int r, int na)
void countAndUpdate (int *outK, int *sx, int *g, int k, int r, int nStr)

Protected Attributes

int32_t t
int32_t d
bool isVerbose

Constructor & Destructor Documentation


Definition at line 23 of file SparseSpatialSampleStringKernel.cpp.


l features of left-hand side
r features of right-hand side

Definition at line 28 of file SparseSpatialSampleStringKernel.cpp.

Definition at line 45 of file SparseSpatialSampleStringKernel.cpp.

Member Function Documentation

void cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 40 of file SparseSpatialSampleStringKernel.cpp.

int * cntsrtna ( int *  sx,
int  k,
int  r,
int  na 
) [protected]

Definition at line 337 of file SparseSpatialSampleStringKernel.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

idx_a index a
idx_b index b
computed kernel function at indices a,b

Implements CKernel.

Definition at line 372 of file SparseSpatialSampleStringKernel.cpp.

void compute_double ( int32_t  idx_a,
int32_t  idx_b 
) [protected]

Definition at line 125 of file SparseSpatialSampleStringKernel.cpp.

void compute_triple ( int32_t  idx_a,
int32_t  idx_b 
) [protected]

Definition at line 191 of file SparseSpatialSampleStringKernel.cpp.

void countAndUpdate ( int *  outK,
int *  sx,
int *  g,
int  k,
int  r,
int  nStr 
) [protected]

Definition at line 268 of file SparseSpatialSampleStringKernel.cpp.

SSKFeatures * extractDouble ( int **  S,
int *  len,
int  nStr,
int  d1 
) [protected]

Definition at line 87 of file SparseSpatialSampleStringKernel.cpp.

SSKFeatures * extractTriple ( int **  S,
int *  len,
int  nStr,
int  d1,
int  d2 
) [protected]

Definition at line 49 of file SparseSpatialSampleStringKernel.cpp.

int32_t get_d (  ) 

Definition at line 72 of file SparseSpatialSampleStringKernel.h.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are


Implements CStringKernel< char >.

Definition at line 61 of file SparseSpatialSampleStringKernel.h.

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

return the kernel's name

name SparseSpatialSample

Reimplemented from CStringKernel< char >.

Definition at line 92 of file SparseSpatialSampleStringKernel.h.

int32_t get_t (  ) 

Definition at line 83 of file SparseSpatialSampleStringKernel.h.

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

initialize kernel

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

Reimplemented from CStringKernel< char >.

Definition at line 34 of file SparseSpatialSampleStringKernel.cpp.

void set_d ( int32_t  max_distance  ) 

Definition at line 66 of file SparseSpatialSampleStringKernel.h.

void set_t ( int32_t  sequence_length  ) 

Definition at line 77 of file SparseSpatialSampleStringKernel.h.

Member Data Documentation

int32_t d [protected]

parameter d of the SSSK denotes maximum allowed distance between words in the sequence

Definition at line 119 of file SparseSpatialSampleStringKernel.h.

bool isVerbose [protected]

Definition at line 120 of file SparseSpatialSampleStringKernel.h.

int32_t t [protected]

parameter t of the SSSK denotes how many words are considered in the sequence (valid are only 2 or 3)

Definition at line 115 of file SparseSpatialSampleStringKernel.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