CCombinedKernel类参考


详细描述

The Combined kernel is used to combine a number of kernels into a single CombinedKernel object by linear combination.

It keeps pointers to the added sub-kernels $k_m({\bf x}, {\bf x'})$ and for each sub-kernel - a kernel specific weight $\beta_m$.

It is especially useful to combine kernels working on different domains and to combine kernels looking at independent features and requires CCombinedFeatures to be used.

It is defined as:

\[ k_{combined}({\bf x}, {\bf x'}) = \sum_{m=1}^M \beta_m k_m({\bf x}, {\bf x'}) \]

在文件CombinedKernel.h46行定义。

继承图,类CCombinedKernel
Inheritance graph
[图例]

所有成员的列表。

公有成员

 CCombinedKernel (int32_t size=10, bool append_subkernel_weights=false)
virtual ~CCombinedKernel ()
virtual bool init (CFeatures *lhs, CFeatures *rhs)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual EFeatureType get_feature_type ()
virtual EFeatureClass get_feature_class ()
virtual const char * get_name () const
void list_kernels ()
CKernelget_first_kernel ()
CKernelget_first_kernel (CListElement< CKernel * > *&current)
CKernelget_kernel (int32_t idx)
CKernelget_last_kernel ()
CKernelget_next_kernel ()
CKernelget_next_kernel (CListElement< CKernel * > *&current)
bool insert_kernel (CKernel *k)
bool append_kernel (CKernel *k)
bool delete_kernel ()
bool get_append_subkernel_weights ()
int32_t get_num_subkernels ()
virtual bool has_features ()
virtual void remove_lhs ()
virtual void remove_rhs ()
virtual void remove_lhs_and_rhs ()
virtual bool init_optimization (int32_t count, int32_t *IDX, float64_t *weights)
virtual bool delete_optimization ()
virtual float64_t compute_optimized (int32_t idx)
virtual void compute_batch (int32_t num_vec, int32_t *vec_idx, float64_t *target, int32_t num_suppvec, int32_t *IDX, float64_t *alphas, float64_t factor=1.0)
void emulate_compute_batch (CKernel *k, int32_t num_vec, int32_t *vec_idx, float64_t *target, int32_t num_suppvec, int32_t *IDX, float64_t *weights)
virtual void add_to_normal (int32_t idx, float64_t weight)
virtual void clear_normal ()
virtual void compute_by_subkernel (int32_t idx, float64_t *subkernel_contrib)
virtual const float64_tget_subkernel_weights (int32_t &num_weights)
virtual void get_subkernel_weights (float64_t **weights, int32_t *num_weights)
virtual void set_subkernel_weights (float64_t *weights, int32_t num_weights)
virtual void set_optimization_type (EOptimizationType t)
bool precompute_subkernels ()

静态公有成员

static void * compute_optimized_kernel_helper (void *p)
static void * compute_kernel_helper (void *p)

保护成员

virtual float64_t compute (int32_t x, int32_t y)
void adjust_num_lhs_rhs_initialized (CKernel *k)

保护属性

CList< CKernel * > * kernel_list
int32_t sv_count
int32_t * sv_idx
float64_tsv_weight
float64_tsubkernel_weights_buffer
bool append_subkernel_weights
bool initialized

构造及析构函数文档

CCombinedKernel ( int32_t  size = 10,
bool  append_subkernel_weights = false 
)

constructor

参数:
size cache size
append_subkernel_weights if subkernel weights shall be appended

在文件CombinedKernel.cpp45行定义。

~CCombinedKernel (  )  [virtual]

在文件CombinedKernel.cpp59行定义。


成员函数文档

void add_to_normal ( int32_t  idx,
float64_t  weight 
) [virtual]

add to normal vector

参数:
idx where to add
weight what to add

重载CKernel

在文件CombinedKernel.cpp582行定义。

void adjust_num_lhs_rhs_initialized ( CKernel k  )  [protected]

adjust the variables num_lhs, num_rhs and initialized based on the kernel to be appended/inserted

参数:
k kernel

在文件CombinedKernel.h394行定义。

bool append_kernel ( CKernel k  ) 

append kernel

参数:
k kernel
返回:
if appending was successful

在文件CombinedKernel.h190行定义。

void cleanup (  )  [virtual]

clean up kernel

重载CKernel

在文件CombinedKernel.cpp208行定义。

void clear_normal (  )  [virtual]

clear normal vector

重载CKernel

在文件CombinedKernel.cpp596行定义。

float64_t compute ( int32_t  x,
int32_t  y 
) [protected, virtual]

compute kernel function

参数:
x x
y y
返回:
computed kernel function

实现了CKernel

在文件CombinedKernel.cpp246行定义。

void compute_batch ( int32_t  num_vec,
int32_t *  vec_idx,
float64_t target,
int32_t  num_suppvec,
int32_t *  IDX,
float64_t alphas,
float64_t  factor = 1.0 
) [virtual]

computes output for a batch of examples in an optimized fashion (favorable if kernel supports it, i.e. has KP_BATCHEVALUATION. to the outputvector target (of length num_vec elements) the output for the examples enumerated in vec_idx are added. therefore make sure that it is initialized with ZERO. the following num_suppvec, IDX, alphas arguments are the number of support vectors, their indices and weights

重载CKernel

在文件CombinedKernel.cpp339行定义。

void compute_by_subkernel ( int32_t  idx,
float64_t subkernel_contrib 
) [virtual]

compute by subkernel

参数:
idx index
subkernel_contrib subkernel contribution

重载CKernel

在文件CombinedKernel.cpp610行定义。

void * compute_kernel_helper ( void *  p  )  [static]

helper for compute kernel

参数:
p thread parameter

在文件CombinedKernel.cpp386行定义。

float64_t compute_optimized ( int32_t  idx  )  [virtual]

compute optimized

参数:
idx index to compute
返回:
optimized value at given index

重载CKernel

在文件CombinedKernel.cpp537行定义。

void * compute_optimized_kernel_helper ( void *  p  )  [static]

helper for compute optimized kernel

参数:
p thread parameter

在文件CombinedKernel.cpp373行定义。

bool delete_kernel (  ) 

delete kernel

返回:
if deleting was successful

在文件CombinedKernel.h206行定义。

bool delete_optimization (  )  [virtual]

delete optimization

返回:
if deleting was successful

重载CKernel

在文件CombinedKernel.cpp313行定义。

void emulate_compute_batch ( CKernel k,
int32_t  num_vec,
int32_t *  vec_idx,
float64_t target,
int32_t  num_suppvec,
int32_t *  IDX,
float64_t weights 
)

emulates batch computation, via linadd optimization w^t x or even down to sum_i alpha_i K(x_i,x)

参数:
k kernel
num_vec number of vectors
vec_idx vector index
target target
num_suppvec number of support vectors
IDX IDX
weights weights

在文件CombinedKernel.cpp408行定义。

bool get_append_subkernel_weights (  ) 

check if subkernel weights are appended

返回:
if subkernel weigths are appended

在文件CombinedKernel.h224行定义。

virtual EFeatureClass get_feature_class (  )  [virtual]

return feature class the kernel can deal with

返回:
feature class COMBINED

实现了CKernel

在文件CombinedKernel.h92行定义。

virtual EFeatureType get_feature_type (  )  [virtual]

return feature type the kernel can deal with

返回:
feature type UNKNOWN

实现了CKernel

在文件CombinedKernel.h83行定义。

CKernel* get_first_kernel ( CListElement< CKernel * > *&  current  ) 

get first kernel

参数:
current 
返回:
first kernel

在文件CombinedKernel.h120行定义。

CKernel* get_first_kernel (  ) 

get first kernel

返回:
first kernel

在文件CombinedKernel.h110行定义。

CKernel* get_kernel ( int32_t  idx  ) 

get kernel

参数:
idx index of kernel
返回:
kernel at index idx

在文件CombinedKernel.h130行定义。

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

返回:
kernel type COMBINED

实现了CKernel

在文件CombinedKernel.h74行定义。

CKernel* get_last_kernel (  ) 

get last kernel

返回:
last kernel

在文件CombinedKernel.h145行定义。

virtual const char* get_name (  )  const [virtual]

return the kernel's name

返回:
name Combined

实现了CSGObject

在文件CombinedKernel.h101行定义。

CKernel* get_next_kernel ( CListElement< CKernel * > *&  current  ) 

get next kernel multi-thread safe

参数:
current 
返回:
next kernel

在文件CombinedKernel.h164行定义。

CKernel* get_next_kernel (  ) 

get next kernel

返回:
next kernel

在文件CombinedKernel.h154行定义。

int32_t get_num_subkernels (  )  [virtual]

get number of subkernels

返回:
number of subkernels

重载CKernel

在文件CombinedKernel.h233行定义。

void get_subkernel_weights ( float64_t **  weights,
int32_t *  num_weights 
) [virtual]

get subkernel weights (swig compatible)

参数:
weights subkernel weights
num_weights number of weights

在文件CombinedKernel.cpp691行定义。

const float64_t * get_subkernel_weights ( int32_t &  num_weights  )  [virtual]

get subkernel weights

参数:
num_weights where number of weights is stored
返回:
subkernel weights

重载CKernel

在文件CombinedKernel.cpp649行定义。

virtual bool has_features (  )  [virtual]

test whether features have been assigned to lhs and rhs

返回:
true if features are assigned

重载CKernel

在文件CombinedKernel.h257行定义。

bool init ( CFeatures lhs,
CFeatures rhs 
) [virtual]

initialize kernel

参数:
lhs features of left-hand side
rhs features of right-hand side
返回:
if initializing was successful

重载CKernel

在文件CombinedKernel.cpp70行定义。

bool init_optimization ( int32_t  count,
int32_t *  IDX,
float64_t weights 
) [virtual]

initialize optimization

参数:
count count
IDX index
weights weights
返回:
if initializing was successful

重载CKernel

在文件CombinedKernel.cpp262行定义。

bool insert_kernel ( CKernel k  ) 

insert kernel

参数:
k kernel
返回:
if inserting was successful

在文件CombinedKernel.h174行定义。

void list_kernels (  ) 

list kernels

在文件CombinedKernel.cpp228行定义。

bool precompute_subkernels (  ) 

precompute all sub-kernels

在文件CombinedKernel.cpp751行定义。

void remove_lhs (  )  [virtual]

remove lhs from kernel

重载CKernel

在文件CombinedKernel.cpp150行定义。

void remove_lhs_and_rhs (  )  [virtual]

remove lhs and rhs from kernel

重载CKernel

在文件CombinedKernel.cpp187行定义。

void remove_rhs (  )  [virtual]

remove rhs from kernel

重载CKernel

在文件CombinedKernel.cpp170行定义。

void set_optimization_type ( EOptimizationType  t  )  [virtual]

set optimization type

参数:
t optimization type

重载CKernel

在文件CombinedKernel.cpp736行定义。

void set_subkernel_weights ( float64_t weights,
int32_t  num_weights 
) [virtual]

set subkernel weights

参数:
weights new subkernel weights
num_weights number of subkernel weights

重载CKernel

在文件CombinedKernel.cpp702行定义。


成员数据文档

bool append_subkernel_weights [protected]

if subkernel weights are appended

在文件CombinedKernel.h441行定义。

bool initialized [protected]

whether kernel is ready to be used

在文件CombinedKernel.h443行定义。

CList<CKernel*>* kernel_list [protected]

list of kernels

在文件CombinedKernel.h431行定义。

subkernel weights buffers

在文件CombinedKernel.h439行定义。

int32_t sv_count [protected]

support vector count

在文件CombinedKernel.h433行定义。

int32_t* sv_idx [protected]

support vector index

在文件CombinedKernel.h435行定义。

float64_t* sv_weight [protected]

support vector weights

在文件CombinedKernel.h437行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation