Public Member Functions | Protected Member Functions | Protected Attributes

CHistogramIntersectionKernel Class Reference

Detailed Description

The HistogramIntersection kernel operating on realvalued vectors computes the histogram intersection distance between sets of histograms. Note: the current implementation assumes positive values for the histograms, and input vectors should sum to 1.

It is defined as

\[ k({\bf x},({\bf x'})= \sum_{i=0}^{l} \mbox{min}(x^{\beta}_i, x'^{\beta}_i) \]

with $\beta=1$ by default

Definition at line 31 of file HistogramIntersectionKernel.h.

Inheritance diagram for CHistogramIntersectionKernel:
Inheritance graph

List of all members.

Public Member Functions

 CHistogramIntersectionKernel (void)
 CHistogramIntersectionKernel (int32_t size)
 CHistogramIntersectionKernel (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r, int32_t size)
virtual ~CHistogramIntersectionKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void register_params ()
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
float64_t get_beta ()
void set_beta (float64_t value)

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

float64_t beta
 beta parameter

Constructor & Destructor Documentation

default constructor

Definition at line 19 of file HistogramIntersectionKernel.cpp.

CHistogramIntersectionKernel ( int32_t  size  ) 


size cache size

Definition at line 25 of file HistogramIntersectionKernel.cpp.


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

Definition at line 31 of file HistogramIntersectionKernel.cpp.

~CHistogramIntersectionKernel (  )  [virtual]

Definition at line 39 of file HistogramIntersectionKernel.cpp.

Member Function Documentation

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

Reimplemented from CDotKernel.

Definition at line 51 of file HistogramIntersectionKernel.cpp.

float64_t get_beta (  ) 

getter for beta parameter

beta value

Definition at line 80 of file HistogramIntersectionKernel.h.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are


Implements CDotKernel.

Definition at line 69 of file HistogramIntersectionKernel.h.

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

return the kernel's name

name HistogramIntersectionKernel

Reimplemented from CDotKernel.

Definition at line 75 of file HistogramIntersectionKernel.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 CDotKernel.

Definition at line 44 of file HistogramIntersectionKernel.cpp.

void register_params (  )  [virtual]

Separate the function of parameter registration This can be the first stage of a *general* framework for cross-validation or other parameter-based operations

Reimplemented from CKernel.

Definition at line 83 of file HistogramIntersectionKernel.cpp.

void set_beta ( float64_t  value  ) 

setter for beta parameter

value beta value

Definition at line 85 of file HistogramIntersectionKernel.h.

Member Data Documentation

float64_t beta [protected]

beta parameter

Definition at line 90 of file HistogramIntersectionKernel.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