The Weighted Degree String kernel.
The WD kernel of order d compares two sequences
and
of length L by summing all contributions of k-mer matches of lengths
, weighted by coefficients
. It is defined as
Here,
is the string of length k starting at position l of the sequence
and
is the indicator function which evaluates to 1 when its argument is true and to 0 otherwise.
在文件WeightedDegreeStringKernel.h第58行定义。

| CWeightedDegreeStringKernel | ( | int32_t | degree, | |
| EWDKernType | type = E_WD | |||
| ) |
constructor
| degree | degree | |
| type | weighted degree kernel type |
在文件WeightedDegreeStringKernel.cpp第55行定义。
| CWeightedDegreeStringKernel | ( | float64_t * | weights, | |
| int32_t | degree | |||
| ) |
| CWeightedDegreeStringKernel | ( | CStringFeatures< char > * | l, | |
| CStringFeatures< char > * | r, | |||
| int32_t | degree | |||
| ) |
constructor
| l | features of left-hand side | |
| r | features of right-hand side | |
| degree | degree |
在文件WeightedDegreeStringKernel.cpp第93行定义。
| ~CWeightedDegreeStringKernel | ( | ) | [virtual] |
| void add_example_to_single_tree | ( | int32_t | idx, | |
| float64_t | weight, | |||
| int32_t | tree_num | |||
| ) | [protected] |
add example to single tree
| idx | index | |
| weight | weight | |
| tree_num | which tree |
| void add_example_to_single_tree_mismatch | ( | int32_t | idx, | |
| float64_t | weight, | |||
| int32_t | tree_num | |||
| ) | [protected] |
add example to single tree mismatch
| idx | index | |
| weight | weight | |
| tree_num | which tree |
| void add_example_to_tree | ( | int32_t | idx, | |
| float64_t | weight | |||
| ) | [protected] |
| void add_example_to_tree_mismatch | ( | int32_t | idx, | |
| float64_t | weight | |||
| ) | [protected] |
| virtual void add_to_normal | ( | int32_t | idx, | |
| float64_t | weight | |||
| ) | [virtual] |
add to normal
| idx | where to add | |
| weight | what to add |
重载CKernel。
在文件WeightedDegreeStringKernel.h第229行定义。
| void cleanup | ( | ) | [virtual] |
| virtual void clear_normal | ( | ) | [virtual] |
| 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
| idx_a | index a | |
| idx_b | index b |
实现了CKernel。
| float64_t * compute_abs_weights | ( | int32_t & | len | ) |
| 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] |
compute batch
| num_vec | number of vectors | |
| vec_idx | vector index | |
| target | target | |
| num_suppvec | number of support vectors | |
| IDX | IDX | |
| alphas | alphas | |
| factor | factor |
重载CKernel。
| void * compute_batch_helper | ( | void * | p | ) | [static] |
| void compute_by_subkernel | ( | int32_t | idx, | |
| float64_t * | subkernel_contrib | |||
| ) | [virtual] |
compute by subkernel
| idx | index | |
| subkernel_contrib | subkernel contribution |
重载CKernel。
在文件WeightedDegreeStringKernel.h第263行定义。
| void compute_by_tree | ( | int32_t | idx, | |
| float64_t * | LevelContrib | |||
| ) |
compute by tree
| idx | index | |
| LevelContrib | level contribution |
| float64_t compute_by_tree | ( | int32_t | idx | ) | [protected] |
| virtual float64_t compute_optimized | ( | int32_t | idx | ) | [virtual] |
compute optimized
| idx | index to compute |
重载CKernel。
在文件WeightedDegreeStringKernel.h第178行定义。
| float64_t compute_using_block | ( | char * | avec, | |
| int32_t | alen, | |||
| char * | bvec, | |||
| int32_t | blen | |||
| ) | [protected] |
compute using block
| avec | vector a | |
| alen | length of vector a | |
| bvec | vector b | |
| blen | length of vector b |
| float64_t compute_with_mismatch | ( | char * | avec, | |
| int32_t | alen, | |||
| char * | bvec, | |||
| int32_t | blen | |||
| ) | [protected] |
compute with mismatch
| avec | vector a | |
| alen | length of vector a | |
| bvec | vector b | |
| blen | length of vector b |
| float64_t compute_without_mismatch | ( | char * | avec, | |
| int32_t | alen, | |||
| char * | bvec, | |||
| int32_t | blen | |||
| ) | [protected] |
compute without mismatch
| avec | vector a | |
| alen | length of vector a | |
| bvec | vector b | |
| blen | length of vector b |
| float64_t compute_without_mismatch_matrix | ( | char * | avec, | |
| int32_t | alen, | |||
| char * | bvec, | |||
| int32_t | blen | |||
| ) | [protected] |
compute without mismatch matrix
| avec | vector a | |
| alen | length of vector a | |
| bvec | vector b | |
| blen | length of vector b |
| void create_empty_tries | ( | ) | [protected] |
create emtpy tries
| bool delete_optimization | ( | ) | [virtual] |
| bool delete_position_weights | ( | ) |
| int32_t get_degree | ( | ) | const |
| int32_t get_degree | ( | ) |
| float64_t* get_degree_weights | ( | int32_t & | d, | |
| int32_t & | len | |||
| ) |
get degree weights
| d | degree weights will be stored here | |
| len | number of degree weights will be stored here |
在文件WeightedDegreeStringKernel.h第405行定义。
| virtual EKernelType get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
实现了CKernel。
在文件WeightedDegreeStringKernel.h第133行定义。
| int32_t get_max_mismatch | ( | ) | const |
get the number of mismatches that are allowed in WD kernel computation
在文件WeightedDegreeStringKernel.h第124行定义。
| int32_t get_max_mismatch | ( | ) |
| int32_t get_mkl_stepsize | ( | ) |
| virtual const char* get_name | ( | ) | const [virtual] |
return the kernel's name
实现了CSGObject。
在文件WeightedDegreeStringKernel.h第139行定义。
| virtual int32_t get_num_subkernels | ( | ) | [virtual] |
| float64_t* get_position_weights | ( | int32_t & | len | ) |
get position weights
| len | number of position weights will be stored here |
在文件WeightedDegreeStringKernel.h第440行定义。
| const float64_t* get_subkernel_weights | ( | int32_t & | num_weights | ) | [virtual] |
get subkernel weights
| num_weights | number of weights will be stored here |
重载CKernel。
在文件WeightedDegreeStringKernel.h第285行定义。
| EWDKernType get_type | ( | ) | const |
get WD kernel weighting type
在文件WeightedDegreeStringKernel.h第105行定义。
| bool get_use_block_computation | ( | ) |
check if block computation is performed
在文件WeightedDegreeStringKernel.h第592行定义。
| float64_t* get_weights | ( | int32_t & | num_weights | ) |
get weights
| num_weights | number of weights will be stored here |
在文件WeightedDegreeStringKernel.h第417行定义。
| int32_t get_which_degree | ( | ) |
initialize kernel
| l | features of left-hand side | |
| r | features of right-hand side |
| bool init_block_weights | ( | ) |
initialize block weights
| bool init_block_weights_const | ( | ) |
initialize block weights constant
| bool init_block_weights_cubicpoly | ( | ) |
initialize block weights cubic polynomial
| bool init_block_weights_exp | ( | ) |
initialize block weights exponential
| bool init_block_weights_external | ( | ) |
initialize block weights external
| bool init_block_weights_from_wd | ( | ) |
initialize block weights from weighted degree
| bool init_block_weights_from_wd_external | ( | ) |
initialize block weights from external weighted degree
| bool init_block_weights_linear | ( | ) |
initialize block weights linear
| bool init_block_weights_log | ( | ) |
initialize block weights logarithmic
| bool init_block_weights_sqpoly | ( | ) |
initialize block weights squared polynomial
| virtual bool init_optimization | ( | int32_t | count, | |
| int32_t * | IDX, | |||
| float64_t * | alphas | |||
| ) | [virtual] |
initialize optimization
| count | count | |
| IDX | index | |
| alphas | alphas |
重载CKernel。
在文件WeightedDegreeStringKernel.h第148行定义。
| bool init_optimization | ( | int32_t | count, | |
| int32_t * | IDX, | |||
| float64_t * | alphas, | |||
| int32_t | tree_num | |||
| ) | [virtual] |
initialize optimization do initialization for tree_num up to upto_tree, use tree_num=-1 to construct all trees
| count | count | |
| IDX | IDX | |
| alphas | alphas | |
| tree_num | which tree |
| bool is_tree_initialized | ( | ) |
| void remove_lhs | ( | ) | [protected, virtual] |
| bool set_degree | ( | int32_t | deg | ) |
| bool set_max_mismatch | ( | int32_t | max | ) |
set maximum mismatch
| max | new maximum mismatch |
| bool set_mkl_stepsize | ( | int32_t | step | ) |
set MKL steps ize
| step | new step size |
在文件WeightedDegreeStringKernel.h第599行定义。
| virtual bool set_normalizer | ( | CKernelNormalizer * | normalizer_ | ) | [virtual] |
set the current kernel normalizer
重载CKernel。
在文件WeightedDegreeStringKernel.h第361行定义。
| bool set_position_weights | ( | float64_t * | position_weights, | |
| int32_t | len = 0 | |||
| ) |
set position weights
| position_weights | new position weights | |
| len | number of position weights |
| void set_subkernel_weights | ( | float64_t * | weights2, | |
| int32_t | num_weights2 | |||
| ) | [virtual] |
set subkernel weights
| weights2 | weights | |
| num_weights2 | number of weights |
重载CKernel。
在文件WeightedDegreeStringKernel.h第311行定义。
| bool set_use_block_computation | ( | bool | block | ) |
set if block computation shall be performed
| block | if block computation shall be performed |
在文件WeightedDegreeStringKernel.h第582行定义。
| void set_wd_weights | ( | float64_t * | p_weights, | |
| int32_t | d | |||
| ) |
set wd weights
| p_weights | new eights | |
| d | degree |
在文件WeightedDegreeStringKernel.h第459行定义。
| bool set_wd_weights_by_type | ( | EWDKernType | type | ) |
set wd weights
| type | weighted degree kernel type |
if we know a better weighting later on do a switch
| bool set_weights | ( | float64_t * | weights, | |
| int32_t | d, | |||
| int32_t | len | |||
| ) |
set weights
| weights | new weights | |
| d | degree | |
| len | number of weights |
| bool set_which_degree | ( | int32_t | which | ) |
set which degree
| which | which degree |
在文件WeightedDegreeStringKernel.h第618行定义。
alphabet of features
在文件WeightedDegreeStringKernel.h第930行定义。
bool block_computation [protected] |
if block computation is used
在文件WeightedDegreeStringKernel.h第909行定义。
float64_t* block_weights [protected] |
(internal) block weights
在文件WeightedDegreeStringKernel.h第917行定义。
float64_t* block_weights_external [protected] |
external block weights
在文件WeightedDegreeStringKernel.h第914行定义。
int32_t degree [protected] |
degree
在文件WeightedDegreeStringKernel.h第896行定义。
bool initialized [protected] |
if kernel is initialized
在文件WeightedDegreeStringKernel.h第906行定义。
int32_t length [protected] |
length
在文件WeightedDegreeStringKernel.h第898行定义。
int32_t max_mismatch [protected] |
maximum mismatch
在文件WeightedDegreeStringKernel.h第901行定义。
int32_t mkl_stepsize [protected] |
MKL step size
在文件WeightedDegreeStringKernel.h第894行定义。
int32_t num_block_weights_external [protected] |
number of external block weights
在文件WeightedDegreeStringKernel.h第912行定义。
float64_t* position_weights [protected] |
position weights
在文件WeightedDegreeStringKernel.h第890行定义。
int32_t seq_length [protected] |
sequence length
在文件WeightedDegreeStringKernel.h第903行定义。
bool tree_initialized [protected] |
if tree is initialized
在文件WeightedDegreeStringKernel.h第927行定义。
tries
在文件WeightedDegreeStringKernel.h第924行定义。
EWDKernType type [protected] |
WeightedDegree kernel type
在文件WeightedDegreeStringKernel.h第919行定义。
degree*length weights length must match seq_length if != 0
在文件WeightedDegreeStringKernel.h第888行定义。
float64_t* weights_buffer [protected] |
weights buffer
在文件WeightedDegreeStringKernel.h第892行定义。
int32_t which_degree [protected] |
which degree
在文件WeightedDegreeStringKernel.h第921行定义。