
Definition at line 22 of file WeightedCommWordStringKernel.h.
| CWeightedCommWordStringKernel::CWeightedCommWordStringKernel | ( | INT | size, | |
| bool | use_sign, | |||
| ENormalizationType | normalization_ = FULL_NORMALIZATION | |||
| ) |
constructor
| size | cache size | |
| use_sign | if sign shall be used | |
| normalization_ | type of normalization |
Definition at line 16 of file WeightedCommWordStringKernel.cpp.
| CWeightedCommWordStringKernel::CWeightedCommWordStringKernel | ( | CStringFeatures< WORD > * | l, | |
| CStringFeatures< WORD > * | r, | |||
| bool | use_sign = false, |
|||
| ENormalizationType | normalization_ = FULL_NORMALIZATION, |
|||
| INT | size = 10 | |||
| ) |
constructor
| l | features of left-hand side | |
| r | features of right-hand side | |
| use_sign | if sign shall be used | |
| normalization_ | type of normalization | |
| size | cache size |
Definition at line 24 of file WeightedCommWordStringKernel.cpp.
| CWeightedCommWordStringKernel::~CWeightedCommWordStringKernel | ( | ) | [virtual] |
Definition at line 35 of file WeightedCommWordStringKernel.cpp.
initialize kernel
| l | features of left-hand side | |
| r | features of right-hand side |
Reimplemented from CCommWordStringKernel.
Definition at line 40 of file WeightedCommWordStringKernel.cpp.
| void CWeightedCommWordStringKernel::cleanup | ( | ) | [virtual] |
clean up kernel
Reimplemented from CCommWordStringKernel.
Definition at line 50 of file WeightedCommWordStringKernel.cpp.
compute optimized
| idx | index to compute |
Reimplemented from CCommWordStringKernel.
Definition at line 256 of file WeightedCommWordStringKernel.cpp.
add to normal
| idx | where to add | |
| weight | what to add |
Reimplemented from CCommWordStringKernel.
Definition at line 198 of file WeightedCommWordStringKernel.cpp.
| void CWeightedCommWordStringKernel::merge_normal | ( | ) |
merge normal
Definition at line 224 of file WeightedCommWordStringKernel.cpp.
| bool CWeightedCommWordStringKernel::set_wd_weights | ( | ) |
set weighted degree weights
Definition at line 57 of file WeightedCommWordStringKernel.cpp.
set custom weights (swig compatible)
| w | weights | |
| d | degree (must match number of weights) |
Definition at line 76 of file WeightedCommWordStringKernel.cpp.
| virtual EKernelType CWeightedCommWordStringKernel::get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Reimplemented from CCommWordStringKernel.
Definition at line 96 of file WeightedCommWordStringKernel.h.
| virtual const CHAR* CWeightedCommWordStringKernel::get_name | ( | ) | [virtual] |
return the kernel's name
Reimplemented from CCommWordStringKernel.
Definition at line 102 of file WeightedCommWordStringKernel.h.
| virtual EFeatureType CWeightedCommWordStringKernel::get_feature_type | ( | ) | [virtual] |
return feature type the kernel can deal with
Reimplemented from CCommWordStringKernel.
Definition at line 108 of file WeightedCommWordStringKernel.h.
| DREAL * CWeightedCommWordStringKernel::compute_scoring | ( | INT | max_degree, | |
| INT & | num_feat, | |||
| INT & | num_sym, | |||
| DREAL * | target, | |||
| INT | num_suppvec, | |||
| INT * | IDX, | |||
| DREAL * | alphas, | |||
| bool | do_init = true | |||
| ) | [virtual] |
compute scoring
| max_degree | maximum degree | |
| num_feat | number of features | |
| num_sym | number of symbols | |
| target | target | |
| num_suppvec | number of support vectors | |
| IDX | IDX | |
| alphas | alphas | |
| do_init | if initialization shall be performed |
Reimplemented from CCommWordStringKernel.
Definition at line 289 of file WeightedCommWordStringKernel.cpp.
| DREAL CWeightedCommWordStringKernel::compute_helper | ( | INT | idx_a, | |
| INT | idx_b, | |||
| bool | do_sort | |||
| ) | [protected, virtual] |
helper for compute
| idx_a | index a | |
| idx_b | index b | |
| do_sort | if sorting shall be performed |
Reimplemented from CCommWordStringKernel.
Definition at line 87 of file WeightedCommWordStringKernel.cpp.
| bool CCommWordStringKernel::load_init | ( | FILE * | src | ) | [virtual, inherited] |
load kernel init_data
| src | file to load from |
Implements CKernel.
Definition at line 187 of file CommWordStringKernel.cpp.
| bool CCommWordStringKernel::save_init | ( | FILE * | dest | ) | [virtual, inherited] |
save kernel init_data
| dest | file to save to |
Implements CKernel.
Definition at line 192 of file CommWordStringKernel.cpp.
| bool CCommWordStringKernel::init_dictionary | ( | INT | size | ) | [virtual, inherited] |
| bool CCommWordStringKernel::init_optimization | ( | INT | count, | |
| INT * | IDX, | |||
| DREAL * | weights | |||
| ) | [virtual, inherited] |
initialize optimization
| count | count | |
| IDX | index | |
| weights | weights |
Reimplemented from CKernel.
Definition at line 409 of file CommWordStringKernel.cpp.
| bool CCommWordStringKernel::delete_optimization | ( | ) | [virtual, inherited] |
delete optimization
Reimplemented from CKernel.
Definition at line 436 of file CommWordStringKernel.cpp.
| void CCommWordStringKernel::clear_normal | ( | ) | [virtual, inherited] |
| void CCommWordStringKernel::remove_lhs | ( | ) | [virtual, inherited] |
remove lhs from kernel
Reimplemented from CKernel.
Definition at line 59 of file CommWordStringKernel.cpp.
| void CCommWordStringKernel::remove_rhs | ( | ) | [virtual, inherited] |
remove rhs from kernel
Reimplemented from CKernel.
Definition at line 79 of file CommWordStringKernel.cpp.
get dictionary
| dsize | dictionary size will be stored in here | |
| dweights | dictionary weights will be stored in here |
Definition at line 164 of file CommWordStringKernel.h.
| CHAR * CCommWordStringKernel::compute_consensus | ( | INT & | num_feat, | |
| INT | num_suppvec, | |||
| INT * | IDX, | |||
| DREAL * | alphas | |||
| ) | [inherited] |
compute consensus
| num_feat | number of features | |
| num_suppvec | number of support vectors | |
| IDX | IDX | |
| alphas | alphas |
Definition at line 612 of file CommWordStringKernel.cpp.
| void CCommWordStringKernel::set_use_dict_diagonal_optimization | ( | bool | flag | ) | [inherited] |
set_use_dict_diagonal_optimization
| flag | enable diagonal optimization |
Definition at line 202 of file CommWordStringKernel.h.
| bool CCommWordStringKernel::get_use_dict_diagonal_optimization | ( | ) | [inherited] |
get.use.dict.diagonal.optimization
Definition at line 211 of file CommWordStringKernel.h.
| virtual DREAL CCommWordStringKernel::compute | ( | INT | idx_a, | |
| INT | idx_b | |||
| ) | [protected, virtual, inherited] |
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 |
Implements CKernel.
Definition at line 225 of file CommWordStringKernel.h.
helper to compute only diagonal normalization for training
| idx_a | index a |
Definition at line 197 of file CommWordStringKernel.cpp.
| DREAL CCommWordStringKernel::normalize_weight | ( | DREAL * | weights, | |
| DREAL | value, | |||
| INT | seq_num, | |||
| INT | seq_len, | |||
| ENormalizationType | p_normalization | |||
| ) | [protected, inherited] |
normalize weight
| weights | weights | |
| value | value | |
| seq_num | sequence number | |
| seq_len | length of sequence | |
| p_normalization | type of normalization |
Definition at line 254 of file CommWordStringKernel.h.
| virtual EFeatureClass CStringKernel< ST >::get_feature_class | ( | ) | [virtual, inherited] |
return feature class the kernel can deal with
Implements CKernel.
Definition at line 63 of file StringKernel.h.
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] |
| virtual void CKernel::set_optimization_type | ( | EOptimizationType | t | ) | [virtual, 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.
| void CKernel::compute_batch | ( | INT | num_vec, | |
| INT * | vec_idx, | |||
| DREAL * | target, | |||
| INT | num_suppvec, | |||
| INT * | IDX, | |||
| DREAL * | alphas, | |||
| DREAL | factor = 1.0 | |||
| ) | [virtual, inherited] |
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 in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 568 of file Kernel.cpp.
| DREAL CKernel::get_combined_kernel_weight | ( | ) | [inherited] |
| void CKernel::set_combined_kernel_weight | ( | double | nw | ) | [inherited] |
| INT CKernel::get_num_subkernels | ( | ) | [virtual, inherited] |
get number of subkernels
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 583 of file Kernel.cpp.
| void CKernel::compute_by_subkernel | ( | INT | vector_idx, | |
| DREAL * | subkernel_contrib | |||
| ) | [virtual, inherited] |
compute by subkernel
| vector_idx | index | |
| subkernel_contrib | subkernel contribution |
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 588 of file Kernel.cpp.
get subkernel weights
| num_weights | number of weights will be stored here |
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 593 of file Kernel.cpp.
set subkernel weights
| weights | subkernel weights | |
| num_weights | number of weights |
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 599 of file Kernel.cpp.
| bool CKernel::get_precompute_matrix | ( | ) | [inherited] |
| bool CKernel::get_precompute_subkernel_matrix | ( | ) | [inherited] |
| virtual void CKernel::set_precompute_matrix | ( | bool | flag, | |
| bool | subkernel_flag | |||
| ) | [virtual, inherited] |
set precompute matrix
| flag | flag | |
| subkernel_flag | subkernel flag |
Reimplemented in CCombinedKernel.
| 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] |
INT CWeightedCommWordStringKernel::degree [protected] |
degree
Definition at line 136 of file WeightedCommWordStringKernel.h.
DREAL* CWeightedCommWordStringKernel::weights [protected] |
weights for each of the subkernels of degree 1...d
Definition at line 139 of file WeightedCommWordStringKernel.h.
DREAL* CCommWordStringKernel::sqrtdiag_lhs [protected, inherited] |
sqrt diagonal of left-hand side
Definition at line 287 of file CommWordStringKernel.h.
DREAL* CCommWordStringKernel::sqrtdiag_rhs [protected, inherited] |
sqrt diagonal of right-hand side
Definition at line 289 of file CommWordStringKernel.h.
bool CCommWordStringKernel::initialized [protected, inherited] |
if kernel is initialized
Definition at line 291 of file CommWordStringKernel.h.
INT CCommWordStringKernel::dictionary_size [protected, inherited] |
size of dictionary (number of possible strings)
Definition at line 294 of file CommWordStringKernel.h.
DREAL* CCommWordStringKernel::dictionary_weights [protected, inherited] |
dictionary weights - array to hold counters for all possible strings
Definition at line 297 of file CommWordStringKernel.h.
bool CCommWordStringKernel::use_sign [protected, inherited] |
if sign shall be used
Definition at line 300 of file CommWordStringKernel.h.
ENormalizationType CCommWordStringKernel::normalization [protected, inherited] |
type of normalization
Definition at line 302 of file CommWordStringKernel.h.
bool CCommWordStringKernel::use_dict_diagonal_optimization [protected, inherited] |
whether diagonal optimization shall be used
Definition at line 305 of file CommWordStringKernel.h.
INT* CCommWordStringKernel::dict_diagonal_optimization [protected, inherited] |
array to hold counters for all strings
Definition at line 307 of file CommWordStringKernel.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.