
and for each sub-kernel - a kernel specific weight
.It is especially useful to combine kernels working on different domains and to combine kernels looking at independent features.
It is defined as:
Definition at line 37 of file CombinedKernel.h.
| CCombinedKernel::CCombinedKernel | ( | INT | size = 10, |
|
| bool | append_subkernel_weights = false | |||
| ) |
constructor
| size | cache size | |
| append_subkernel_weights | if subkernel weights shall be appended |
Definition at line 40 of file CombinedKernel.cpp.
| CCombinedKernel::CCombinedKernel | ( | CCombinedFeatures * | l, | |
| CCombinedFeatures * | r, | |||
| bool | append_subkernel_weights = false | |||
| ) |
constructor
| l | features for left-hand side | |
| r | features for right-hand side | |
| append_subkernel_weights | if subkernel weights shall be appended |
Definition at line 51 of file CombinedKernel.cpp.
| CCombinedKernel::~CCombinedKernel | ( | ) | [virtual] |
Definition at line 65 of file CombinedKernel.cpp.
initialize kernel
| lhs | features of left-hand side | |
| rhs | features of right-hand side |
Reimplemented from CKernel.
Definition at line 76 of file CombinedKernel.cpp.
| void CCombinedKernel::cleanup | ( | ) | [virtual] |
| virtual bool CCombinedKernel::load_init | ( | FILE * | src | ) | [virtual] |
load kernel init_data
NOT IMPLEMENTED!
| src | file to load from |
Implements CKernel.
Definition at line 78 of file CombinedKernel.h.
| virtual bool CCombinedKernel::save_init | ( | FILE * | dest | ) | [virtual] |
save kernel init_data
NOT IMPLEMENTED!
| dest | file to save to |
Implements CKernel.
Definition at line 87 of file CombinedKernel.h.
| virtual EKernelType CCombinedKernel::get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Implements CKernel.
Definition at line 93 of file CombinedKernel.h.
| virtual EFeatureType CCombinedKernel::get_feature_type | ( | ) | [virtual] |
return feature type the kernel can deal with
Implements CKernel.
Definition at line 102 of file CombinedKernel.h.
| virtual EFeatureClass CCombinedKernel::get_feature_class | ( | ) | [virtual] |
return feature class the kernel can deal with
Implements CKernel.
Definition at line 111 of file CombinedKernel.h.
| virtual const CHAR* CCombinedKernel::get_name | ( | ) | [virtual] |
return the kernel's name
Implements CKernel.
Definition at line 120 of file CombinedKernel.h.
| void CCombinedKernel::list_kernels | ( | ) |
list kernels
Definition at line 199 of file CombinedKernel.cpp.
| CKernel* CCombinedKernel::get_first_kernel | ( | ) |
| CKernel* CCombinedKernel::get_first_kernel | ( | CListElement< CKernel * > *& | current | ) |
get first kernel
| current |
Definition at line 139 of file CombinedKernel.h.
get kernel
| idx | index of kernel |
Definition at line 149 of file CombinedKernel.h.
| CKernel* CCombinedKernel::get_last_kernel | ( | ) |
get next kernel
| current |
Definition at line 171 of file CombinedKernel.h.
| CKernel* CCombinedKernel::get_next_kernel | ( | CListElement< CKernel * > *& | current | ) |
get next kernel multi-thread safe
| current |
Definition at line 182 of file CombinedKernel.h.
| bool CCombinedKernel::insert_kernel | ( | CKernel * | k | ) |
insert kernel
| k | kernel |
Definition at line 192 of file CombinedKernel.h.
| bool CCombinedKernel::append_kernel | ( | CKernel * | k | ) |
append kernel
| k | kernel |
Definition at line 208 of file CombinedKernel.h.
| bool CCombinedKernel::delete_kernel | ( | ) |
| bool CCombinedKernel::get_append_subkernel_weights | ( | ) |
check if subkernel weights are appended
Definition at line 235 of file CombinedKernel.h.
| int CCombinedKernel::get_num_subkernels | ( | ) | [virtual] |
get number of subkernels
Reimplemented from CKernel.
Definition at line 244 of file CombinedKernel.h.
| void CCombinedKernel::remove_lhs | ( | ) | [virtual] |
remove lhs from kernel
Reimplemented from CKernel.
Definition at line 145 of file CombinedKernel.cpp.
| void CCombinedKernel::remove_rhs | ( | ) | [virtual] |
remove rhs from kernel
Reimplemented from CKernel.
Definition at line 165 of file CombinedKernel.cpp.
initialize optimization
| count | count | |
| IDX | index | |
| weights | weights |
Reimplemented from CKernel.
Definition at line 231 of file CombinedKernel.cpp.
| bool CCombinedKernel::delete_optimization | ( | ) | [virtual] |
delete optimization
Reimplemented from CKernel.
Definition at line 281 of file CombinedKernel.cpp.
compute optimized
| idx | index to compute |
Reimplemented from CKernel.
Definition at line 497 of file CombinedKernel.cpp.
| void CCombinedKernel::compute_batch | ( | INT | num_vec, | |
| INT * | vec_idx, | |||
| DREAL * | target, | |||
| INT | num_suppvec, | |||
| INT * | IDX, | |||
| DREAL * | alphas, | |||
| DREAL | 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
Reimplemented from CKernel.
Definition at line 306 of file CombinedKernel.cpp.
| void * CCombinedKernel::compute_optimized_kernel_helper | ( | void * | p | ) | [static] |
helper for compute optimized kernel
| p | thread parameter |
Definition at line 338 of file CombinedKernel.cpp.
| void * CCombinedKernel::compute_kernel_helper | ( | void * | p | ) | [static] |
helper for compute kernel
| p | thread parameter |
Definition at line 351 of file CombinedKernel.cpp.
| void CCombinedKernel::emulate_compute_batch | ( | CKernel * | k, | |
| INT | num_vec, | |||
| INT * | vec_idx, | |||
| DREAL * | target, | |||
| INT | num_suppvec, | |||
| INT * | IDX, | |||
| DREAL * | 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 |
Definition at line 374 of file CombinedKernel.cpp.
add to normal vector
| idx | where to add | |
| weight | what to add |
Reimplemented from CKernel.
Definition at line 540 of file CombinedKernel.cpp.
| void CCombinedKernel::clear_normal | ( | ) | [virtual] |
compute by subkernel
| idx | index | |
| subkernel_contrib | subkernel contribution |
Reimplemented from CKernel.
Definition at line 566 of file CombinedKernel.cpp.
get subkernel weights
| num_weights | where number of weights is stored |
Reimplemented from CKernel.
Definition at line 601 of file CombinedKernel.cpp.
set subkernel weights
| weights | new subkernel weights | |
| num_weights | number of subkernel weights |
Reimplemented from CKernel.
Definition at line 639 of file CombinedKernel.cpp.
| void CCombinedKernel::set_optimization_type | ( | EOptimizationType | t | ) | [virtual] |
set optimization type
| t | optimization type |
Reimplemented from CKernel.
Definition at line 668 of file CombinedKernel.cpp.
| virtual void CCombinedKernel::set_precompute_matrix | ( | bool | flag, | |
| bool | subkernel_flag | |||
| ) | [virtual] |
set precompute matrix
| flag | flag | |
| subkernel_flag | subkernel flag |
Reimplemented from CKernel.
Definition at line 364 of file CombinedKernel.h.
compute kernel function
| x | x | |
| y | y |
Implements CKernel.
Definition at line 216 of file CombinedKernel.cpp.
get kernel matrix
| dst | destination where matrix will be stored | |
| m | dimension m of matrix | |
| n | dimension n of matrix |
Definition at line 79 of file Kernel.cpp.
get kernel matrix real
| m | dimension m of matrix | |
| n | dimension n of matrix | |
| target | the kernel matrix |
Definition at line 216 of file Kernel.cpp.
| SHORTREAL * CKernel::get_kernel_matrix_shortreal | ( | int & | m, | |
| int & | n, | |||
| SHORTREAL * | target | |||
| ) | [virtual, inherited] |
get kernel matrix shortreal
| m | dimension m of matrix | |
| n | dimension n of matrix | |
| target | target for kernel matrix |
Reimplemented in CCustomKernel.
Definition at line 146 of file Kernel.cpp.
| bool CKernel::load | ( | CHAR * | fname | ) | [inherited] |
load the kernel matrix
| fname | filename to load from |
Definition at line 322 of file Kernel.cpp.
| bool CKernel::save | ( | CHAR * | fname | ) | [inherited] |
save kernel matrix
| fname | filename to save to |
Definition at line 327 of file Kernel.cpp.
| CFeatures* CKernel::get_lhs | ( | ) | [inherited] |
| CFeatures* CKernel::get_rhs | ( | ) | [inherited] |
| INT CKernel::get_num_vec_lhs | ( | ) | [inherited] |
| INT CKernel::get_num_vec_rhs | ( | ) | [inherited] |
| bool CKernel::has_features | ( | ) | [inherited] |
| void CKernel::remove_lhs_and_rhs | ( | ) | [virtual, inherited] |
remove lhs and rhs from kernel
Definition at line 358 of file Kernel.cpp.
| void CKernel::set_cache_size | ( | INT | size | ) | [inherited] |
| int CKernel::get_cache_size | ( | ) | [inherited] |
| void CKernel::list_kernel | ( | ) | [inherited] |
list kernel
Definition at line 389 of file Kernel.cpp.
| bool CKernel::has_property | ( | EKernelProperty | p | ) | [inherited] |
| EOptimizationType CKernel::get_optimization_type | ( | ) | [inherited] |
| bool CKernel::get_is_initialized | ( | ) | [inherited] |
| bool CKernel::init_optimization_svm | ( | CSVM * | svm | ) | [inherited] |
initialize optimization
| svm | svm model |
Definition at line 644 of file Kernel.cpp.
| DREAL CKernel::get_combined_kernel_weight | ( | ) | [inherited] |
| void CKernel::set_combined_kernel_weight | ( | double | nw | ) | [inherited] |
| bool CKernel::get_precompute_matrix | ( | ) | [inherited] |
| bool CKernel::get_precompute_subkernel_matrix | ( | ) | [inherited] |
| void CKernel::set_property | ( | EKernelProperty | p | ) | [protected, inherited] |
| void CKernel::unset_property | ( | EKernelProperty | p | ) | [protected, inherited] |
| void CKernel::set_is_initialized | ( | bool | p_init | ) | [protected, inherited] |
| void CKernel::do_precompute_matrix | ( | ) | [protected, inherited] |
CList<CKernel*>* CCombinedKernel::kernel_list [protected] |
list of kernels
Definition at line 394 of file CombinedKernel.h.
INT CCombinedKernel::sv_count [protected] |
support vector count
Definition at line 396 of file CombinedKernel.h.
INT* CCombinedKernel::sv_idx [protected] |
support vector index
Definition at line 398 of file CombinedKernel.h.
DREAL* CCombinedKernel::sv_weight [protected] |
support vector weights
Definition at line 400 of file CombinedKernel.h.
DREAL* CCombinedKernel::subkernel_weights_buffer [protected] |
subkernel weights buffers
Definition at line 402 of file CombinedKernel.h.
bool CCombinedKernel::append_subkernel_weights [protected] |
if subkernel weights are appended
Definition at line 404 of file CombinedKernel.h.
INT CKernel::cache_size [protected, inherited] |
KERNELCACHE_ELEM* CKernel::kernel_matrix [protected, inherited] |
SHORTREAL* CKernel::precomputed_matrix [protected, inherited] |
bool CKernel::precompute_subkernel_matrix [protected, inherited] |
bool CKernel::precompute_matrix [protected, inherited] |
CFeatures* CKernel::lhs [protected, inherited] |
CFeatures* CKernel::rhs [protected, inherited] |
DREAL CKernel::combined_kernel_weight [protected, inherited] |
bool CKernel::optimization_initialized [protected, inherited] |
EOptimizationType CKernel::opt_type [protected, inherited] |
ULONG CKernel::properties [protected, inherited] |
CParallel CSGObject::parallel [static, inherited] |
Definition at line 105 of file SGObject.h.
CIO CSGObject::io [static, inherited] |
Definition at line 106 of file SGObject.h.
CVersion CSGObject::version [static, inherited] |
Definition at line 107 of file SGObject.h.