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
[legend]

List of all members.

Public Member Functions

 CHistogramIntersectionKernel ()
 CHistogramIntersectionKernel (int32_t size)
 CHistogramIntersectionKernel (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r, float64_t beta=1.0, int32_t size=10)
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 beta)

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

float64_t m_beta
 beta parameter

Constructor & Destructor Documentation

default constructor

Definition at line 19 of file HistogramIntersectionKernel.cpp.

CHistogramIntersectionKernel ( int32_t  size  ) 

constructor

Parameters:
size cache size

Definition at line 25 of file HistogramIntersectionKernel.cpp.

CHistogramIntersectionKernel ( CSimpleFeatures< float64_t > *  l,
CSimpleFeatures< float64_t > *  r,
float64_t  beta = 1.0,
int32_t  size = 10 
)

constructor

Parameters:
l features of left-hand side
r features of right-hand side
beta kernel parameter
size cache size

Definition at line 31 of file HistogramIntersectionKernel.cpp.

~CHistogramIntersectionKernel (  )  [virtual]

Definition at line 40 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

Parameters:
idx_a index a
idx_b index b
Returns:
computed kernel function at indices a,b

Reimplemented from CDotKernel.

Definition at line 52 of file HistogramIntersectionKernel.cpp.

float64_t get_beta (  ) 

getter for beta parameter

Returns:
beta value

Definition at line 82 of file HistogramIntersectionKernel.h.

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type HISTOGRAMINTERSECTION

Implements CDotKernel.

Definition at line 71 of file HistogramIntersectionKernel.h.

virtual const char* get_name (  )  const [virtual]

return the kernel's name

Returns:
name HistogramIntersectionKernel

Reimplemented from CDotKernel.

Definition at line 77 of file HistogramIntersectionKernel.h.

bool 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 CDotKernel.

Definition at line 45 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 84 of file HistogramIntersectionKernel.cpp.

void set_beta ( float64_t  beta  ) 

setter for beta parameter

Parameters:
beta beta value

Definition at line 87 of file HistogramIntersectionKernel.h.


Member Data Documentation

float64_t m_beta [protected]

beta parameter

Definition at line 92 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