SHOGUN v0.9.0
公有成员 | 静态公有成员 | 保护成员 | 保护属性
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 *&current)
CKernelget_kernel (int32_t idx)
CKernelget_last_kernel ()
CKernelget_next_kernel ()
CKernelget_next_kernel (CListElement *&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)

保护属性

CListkernel_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

参数:
sizecache size
append_subkernel_weightsif subkernel weights shall be appended

在文件CombinedKernel.cpp45行定义。

~CCombinedKernel ( ) [virtual]

在文件CombinedKernel.cpp56行定义。


成员函数文档

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

add to normal vector

参数:
idxwhere to add
weightwhat to add

重载CKernel

在文件CombinedKernel.cpp579行定义。

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

参数:
kkernel

在文件CombinedKernel.h394行定义。

bool append_kernel ( CKernel k)

append kernel

参数:
kkernel
返回:
if appending was successful

在文件CombinedKernel.h190行定义。

void cleanup ( ) [virtual]

clean up kernel

重载CKernel

在文件CombinedKernel.cpp205行定义。

void clear_normal ( ) [virtual]

clear normal vector

重载CKernel

在文件CombinedKernel.cpp593行定义。

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

compute kernel function

参数:
xx
yy
返回:
computed kernel function

实现了CKernel

在文件CombinedKernel.cpp243行定义。

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.cpp336行定义。

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

compute by subkernel

参数:
idxindex
subkernel_contribsubkernel contribution

重载CKernel

在文件CombinedKernel.cpp607行定义。

void * compute_kernel_helper ( void *  p) [static]

helper for compute kernel

参数:
pthread parameter

在文件CombinedKernel.cpp383行定义。

float64_t compute_optimized ( int32_t  idx) [virtual]

compute optimized

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

重载CKernel

在文件CombinedKernel.cpp534行定义。

void * compute_optimized_kernel_helper ( void *  p) [static]

helper for compute optimized kernel

参数:
pthread parameter

在文件CombinedKernel.cpp370行定义。

bool delete_kernel ( )

delete kernel

返回:
if deleting was successful

在文件CombinedKernel.h206行定义。

bool delete_optimization ( ) [virtual]

delete optimization

返回:
if deleting was successful

重载CKernel

在文件CombinedKernel.cpp310行定义。

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)

参数:
kkernel
num_vecnumber of vectors
vec_idxvector index
targettarget
num_suppvecnumber of support vectors
IDXIDX
weightsweights

在文件CombinedKernel.cpp405行定义。

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 ( )

get first kernel

返回:
first kernel

在文件CombinedKernel.h110行定义。

CKernel* get_first_kernel ( CListElement *&  current)

get first kernel

参数:
current
返回:
first kernel

在文件CombinedKernel.h120行定义。

CKernel* get_kernel ( int32_t  idx)

get kernel

参数:
idxindex 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 ( void  ) const [virtual]

return the kernel's name

返回:
name Combined

实现了CSGObject

在文件CombinedKernel.h101行定义。

CKernel* get_next_kernel ( )

get next kernel

返回:
next kernel

在文件CombinedKernel.h154行定义。

CKernel* get_next_kernel ( CListElement *&  current)

get next kernel multi-thread safe

参数:
current
返回:
next kernel

在文件CombinedKernel.h164行定义。

int32_t get_num_subkernels ( ) [virtual]

get number of subkernels

返回:
number of subkernels

重载CKernel

在文件CombinedKernel.h233行定义。

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

get subkernel weights

参数:
num_weightswhere number of weights is stored
返回:
subkernel weights

重载CKernel

在文件CombinedKernel.cpp646行定义。

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

get subkernel weights (swig compatible)

参数:
weightssubkernel weights
num_weightsnumber of weights

在文件CombinedKernel.cpp688行定义。

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

参数:
lhsfeatures of left-hand side
rhsfeatures of right-hand side
返回:
if initializing was successful

重载CKernel

在文件CombinedKernel.cpp67行定义。

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

initialize optimization

参数:
countcount
IDXindex
weightsweights
返回:
if initializing was successful

重载CKernel

在文件CombinedKernel.cpp259行定义。

bool insert_kernel ( CKernel k)

insert kernel

参数:
kkernel
返回:
if inserting was successful

在文件CombinedKernel.h174行定义。

void list_kernels ( )

list kernels

在文件CombinedKernel.cpp225行定义。

bool precompute_subkernels ( )

precompute all sub-kernels

在文件CombinedKernel.cpp748行定义。

void remove_lhs ( ) [virtual]

remove lhs from kernel

重载CKernel

在文件CombinedKernel.cpp147行定义。

void remove_lhs_and_rhs ( ) [virtual]

remove lhs and rhs from kernel

重载CKernel

在文件CombinedKernel.cpp184行定义。

void remove_rhs ( ) [virtual]

remove rhs from kernel

重载CKernel

在文件CombinedKernel.cpp167行定义。

void set_optimization_type ( EOptimizationType  t) [virtual]

set optimization type

参数:
toptimization type

重载CKernel

在文件CombinedKernel.cpp733行定义。

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

set subkernel weights

参数:
weightsnew subkernel weights
num_weightsnumber of subkernel weights

重载CKernel

在文件CombinedKernel.cpp699行定义。


成员数据文档

bool append_subkernel_weights [protected]

if subkernel weights are appended

在文件CombinedKernel.h444行定义。

bool initialized [protected]

whether kernel is ready to be used

在文件CombinedKernel.h446行定义。

CList* kernel_list [protected]

list of kernels

在文件CombinedKernel.h434行定义。

subkernel weights buffers

在文件CombinedKernel.h442行定义。

int32_t sv_count [protected]

support vector count

在文件CombinedKernel.h436行定义。

int32_t* sv_idx [protected]

support vector index

在文件CombinedKernel.h438行定义。

float64_t* sv_weight [protected]

support vector weights

在文件CombinedKernel.h440行定义。


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

SHOGUN Machine Learning Toolbox - Documentation