Pyramid Kernel over Chi2 matched histograms.
Definition at line 28 of file PyramidChi2.h.
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_t * | weights |
int32_t | width_computation_type |
float64_t | width |
int32_t | num_randfeats_forwidthcomputation |
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
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
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.
void cleanup | ( | ) | [virtual] |
float64_t compute | ( | int32_t | idx_a, | |
int32_t | idx_b | |||
) | [protected, virtual] |
compute kernel function for features a and b
idx_a | index of feature vector a | |
idx_b | index of feature vector b |
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.
init
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
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.
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.
vector of weights for each pyramid cell
Definition at line 134 of file PyramidChi2.h.
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.