Public Member Functions | Protected Member Functions | Protected Attributes

CPyramidChi2 Class Reference


Detailed Description

Pyramid Kernel over Chi2 matched histograms.

Definition at line 28 of file PyramidChi2.h.

Inheritance diagram for CPyramidChi2:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPyramidChi2 (void)
 CPyramidChi2 (int32_t size, int32_t num_cells2, float64_t *weights_foreach_cell2, int32_t width_computation_type2, float64_t width2)
 CPyramidChi2 (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r, int32_t size, int32_t num_cells2, float64_t *weights_foreach_cell2, int32_t width_computation_type2, float64_t width2)
virtual bool init (CFeatures *l, CFeatures *r)
virtual ~CPyramidChi2 ()
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
virtual void setparams_pychi2 (int32_t num_cells2, float64_t *weights_foreach_cell2, int32_t width_computation_type2, float64_t width2)

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

int32_t num_cells
float64_tweights
int32_t width_computation_type
float64_t width
int32_t num_randfeats_forwidthcomputation

Constructor & Destructor Documentation

CPyramidChi2 ( void   ) 

default constructor protected to avoid its usage

Definition at line 21 of file PyramidChi2.cpp.

CPyramidChi2 ( int32_t  size,
int32_t  num_cells2,
float64_t weights_foreach_cell2,
int32_t  width_computation_type2,
float64_t  width2 
)

constructor

Parameters:
size cache size in MB
num_cells2 - the number of pyramid cells
weights_foreach_cell2 the vector of weights for each cell with which the Chi2 distance gets weighted
width_computation_type2 - 0 use the following parameter as fixed width, 1- use mean of inner distances in cases 1 and 2 the value of parameter width is still important, see parameter width2
width2 - in case of width_computation_type ==0 it is the width, in case of width_computation_type > 0 its value determines the how many random features are used for determining the width in case of width_computation_type > 0 set width2 <=1 to use all LEFT HAND SIDE features for width estimation

Definition at line 31 of file PyramidChi2.cpp.

CPyramidChi2 ( CSimpleFeatures< float64_t > *  l,
CSimpleFeatures< float64_t > *  r,
int32_t  size,
int32_t  num_cells2,
float64_t weights_foreach_cell2,
int32_t  width_computation_type2,
float64_t  width2 
)

constructor

Parameters:
l features lhs convention: concatenated features along all cells, i.e. [feature for cell1, feature for cell2, ... feature for last cell] , the dimensionality of the base feature is equal to dividing the total feature length by the number ofcells
r features rhs the same convention as for param l applies here
size cache size
num_cells2 - the number of pyramid cells
weights_foreach_cell2 the vector of weights for each cell with which the Chi2 distance gets weighted
width_computation_type2 - 0 use the following parameter as fixed width, 1- use mean of inner distances in case 1 the value of parameter width is important!!!
width2 - in case of width_computation_type ==0 it is the width, in case of width_computation_type > 0 its value determines the how many random features are used for determining the width in case of width_computation_type > 0 set width2 <=1 to use all LEFT HAND SIDE features for width estimation

Definition at line 83 of file PyramidChi2.cpp.

~CPyramidChi2 (  )  [virtual]

Definition at line 115 of file PyramidChi2.cpp.


Member Function Documentation

void cleanup (  )  [virtual]

cleanup

Reimplemented from CKernel.

Definition at line 62 of file PyramidChi2.cpp.

float64_t compute ( int32_t  idx_a,
int32_t  idx_b 
) [protected, virtual]

compute kernel function for features a and b

Parameters:
idx_a index of feature vector a
idx_b index of feature vector b
Returns:
computed kernel function

Reimplemented from CDotKernel.

Definition at line 122 of file PyramidChi2.cpp.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are Linear,Polynomial, Gaussian,...

Implements CDotKernel.

Definition at line 92 of file PyramidChi2.h.

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

return the name of a kernel

Reimplemented from CDotKernel.

Definition at line 98 of file PyramidChi2.h.

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

init

Parameters:
l features lhs
r reatures rhs

Reimplemented from CDotKernel.

Definition at line 77 of file PyramidChi2.cpp.

void setparams_pychi2 ( int32_t  num_cells2,
float64_t weights_foreach_cell2,
int32_t  width_computation_type2,
float64_t  width2 
) [virtual]

sets parameters, see also constructor

Parameters:
num_cells2 - the number of pyramid cells
weights_foreach_cell2 the vector of weights for each cell with which the Chi2 distance gets weighted
width_computation_type2 - 0 use the following parameter as fixed width, 1- use mean of inner distances in cases 1 and 2 the value of parameter width is still important, see parameter width2
width2 - in case of width_computation_type ==0 it is the width, in case of width_computation_type > 0 its value determines the how many random features are used for determining the width in case of width_computation_type > 0 set width2 <=1 to use all LEFT HAND SIDE features for width estimation

Definition at line 242 of file PyramidChi2.cpp.


Member Data Documentation

int32_t num_cells [protected]

number of pyramidcells across all pyramidlevel

Definition at line 131 of file PyramidChi2.h.

int32_t num_randfeats_forwidthcomputation [protected]

in case of adaptive width computation: how many features to use

Definition at line 141 of file PyramidChi2.h.

float64_t* weights [protected]

vector of weights for each pyramid cell

Definition at line 134 of file PyramidChi2.h.

float64_t width [protected]

width

Definition at line 139 of file PyramidChi2.h.

int32_t width_computation_type [protected]

width_computation_type

Definition at line 137 of file PyramidChi2.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