公有成员 | 静态公有成员 | 保护成员 | 保护属性

CWeightedDegreeStringKernel类参考


详细描述

The Weighted Degree String kernel.

The WD kernel of order d compares two sequences ${\bf x}$ and ${\bf x'}$ of length L by summing all contributions of k-mer matches of lengths $k\in\{1,\dots,d\}$, weighted by coefficients $\beta_k$. It is defined as

\[ k({\bf x},{\bf x'})=\sum_{k=1}^d\beta_k\sum_{l=1}^{L-k+1}I({\bf u}_{k,l}({\bf x})={\bf u}_{k,l}({\bf x'})). \]

Here, ${\bf u}_{k,l}({\bf x})$ is the string of length k starting at position l of the sequence ${\bf x}$ and $I(\cdot)$ is the indicator function which evaluates to 1 when its argument is true and to 0 otherwise.

在文件WeightedDegreeStringKernel.h58行定义。

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

所有成员的列表。

公有成员

 CWeightedDegreeStringKernel (int32_t degree, EWDKernType type=E_WD)
 CWeightedDegreeStringKernel (float64_t *weights, int32_t degree)
 CWeightedDegreeStringKernel (CStringFeatures< char > *l, CStringFeatures< char > *r, int32_t degree)
virtual ~CWeightedDegreeStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
EWDKernType get_type () const
int32_t get_degree () const
int32_t get_max_mismatch () const
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
virtual bool init_optimization (int32_t count, int32_t *IDX, float64_t *alphas)
virtual bool init_optimization (int32_t count, int32_t *IDX, float64_t *alphas, int32_t tree_num)
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)
virtual void clear_normal ()
virtual void add_to_normal (int32_t idx, float64_t weight)
virtual int32_t get_num_subkernels ()
void compute_by_subkernel (int32_t idx, float64_t *subkernel_contrib)
const float64_tget_subkernel_weights (int32_t &num_weights)
void set_subkernel_weights (float64_t *weights2, int32_t num_weights2)
virtual bool set_normalizer (CKernelNormalizer *normalizer_)
float64_tcompute_abs_weights (int32_t &len)
void compute_by_tree (int32_t idx, float64_t *LevelContrib)
bool is_tree_initialized ()
float64_tget_degree_weights (int32_t &d, int32_t &len)
float64_tget_weights (int32_t &num_weights)
float64_tget_position_weights (int32_t &len)
bool set_wd_weights_by_type (EWDKernType type)
void set_wd_weights (float64_t *p_weights, int32_t d)
bool set_weights (float64_t *weights, int32_t d, int32_t len)
bool set_position_weights (float64_t *position_weights, int32_t len=0)
bool init_block_weights ()
bool init_block_weights_from_wd ()
bool init_block_weights_from_wd_external ()
bool init_block_weights_const ()
bool init_block_weights_linear ()
bool init_block_weights_sqpoly ()
bool init_block_weights_cubicpoly ()
bool init_block_weights_exp ()
bool init_block_weights_log ()
bool init_block_weights_external ()
bool delete_position_weights ()
bool set_max_mismatch (int32_t max)
int32_t get_max_mismatch ()
bool set_degree (int32_t deg)
int32_t get_degree ()
bool set_use_block_computation (bool block)
bool get_use_block_computation ()
bool set_mkl_stepsize (int32_t step)
int32_t get_mkl_stepsize ()
bool set_which_degree (int32_t which)
int32_t get_which_degree ()

静态公有成员

static void * compute_batch_helper (void *p)

保护成员

void create_empty_tries ()
void add_example_to_tree (int32_t idx, float64_t weight)
void add_example_to_single_tree (int32_t idx, float64_t weight, int32_t tree_num)
void add_example_to_tree_mismatch (int32_t idx, float64_t weight)
void add_example_to_single_tree_mismatch (int32_t idx, float64_t weight, int32_t tree_num)
float64_t compute_by_tree (int32_t idx)
float64_t compute (int32_t idx_a, int32_t idx_b)
float64_t compute_with_mismatch (char *avec, int32_t alen, char *bvec, int32_t blen)
float64_t compute_without_mismatch (char *avec, int32_t alen, char *bvec, int32_t blen)
float64_t compute_without_mismatch_matrix (char *avec, int32_t alen, char *bvec, int32_t blen)
float64_t compute_using_block (char *avec, int32_t alen, char *bvec, int32_t blen)
virtual void remove_lhs ()

保护属性

float64_tweights
float64_tposition_weights
float64_tweights_buffer
int32_t mkl_stepsize
int32_t degree
int32_t length
int32_t max_mismatch
int32_t seq_length
bool initialized
bool block_computation
int32_t num_block_weights_external
float64_tblock_weights_external
float64_tblock_weights
EWDKernType type
int32_t which_degree
CTrie< DNATrie > * tries
bool tree_initialized
CAlphabetalphabet

构造及析构函数文档

CWeightedDegreeStringKernel ( int32_t  degree,
EWDKernType  type = E_WD 
)

constructor

参数:
degreedegree
typeweighted degree kernel type

在文件WeightedDegreeStringKernel.cpp55行定义。

CWeightedDegreeStringKernel ( float64_t weights,
int32_t  degree 
)

constructor

参数:
weightskernel's weights
degreedegree

在文件WeightedDegreeStringKernel.cpp74行定义。

CWeightedDegreeStringKernel ( CStringFeatures< char > *  l,
CStringFeatures< char > *  r,
int32_t  degree 
)

constructor

参数:
lfeatures of left-hand side
rfeatures of right-hand side
degreedegree

在文件WeightedDegreeStringKernel.cpp93行定义。

~CWeightedDegreeStringKernel (  ) [virtual]

在文件WeightedDegreeStringKernel.cpp109行定义。


成员函数文档

void add_example_to_single_tree ( int32_t  idx,
float64_t  weight,
int32_t  tree_num 
) [protected]

add example to single tree

参数:
idxindex
weightweight
tree_numwhich tree

在文件WeightedDegreeStringKernel.cpp446行定义。

void add_example_to_single_tree_mismatch ( int32_t  idx,
float64_t  weight,
int32_t  tree_num 
) [protected]

add example to single tree mismatch

参数:
idxindex
weightweight
tree_numwhich tree

在文件WeightedDegreeStringKernel.cpp497行定义。

void add_example_to_tree ( int32_t  idx,
float64_t  weight 
) [protected]

add example to tree

参数:
idxindex
weightweight

在文件WeightedDegreeStringKernel.cpp400行定义。

void add_example_to_tree_mismatch ( int32_t  idx,
float64_t  weight 
) [protected]

add example to tree mismatch

参数:
idxindex
weightweight

在文件WeightedDegreeStringKernel.cpp471行定义。

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

add to normal

参数:
idxwhere to add
weightwhat to add

重载CKernel

在文件WeightedDegreeStringKernel.h229行定义。

void cleanup (  ) [virtual]

clean up kernel

重载CKernel

在文件WeightedDegreeStringKernel.cpp193行定义。

virtual void clear_normal (  ) [virtual]

clear normal subkernel functionality

重载CKernel

在文件WeightedDegreeStringKernel.h211行定义。

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_aindex a
idx_bindex b
返回:
computed kernel function at indices a,b

实现了CKernel

在文件WeightedDegreeStringKernel.cpp374行定义。

float64_t * compute_abs_weights ( int32_t &  len )

compute abs weights

参数:
lenlen
返回:
computed abs weights

在文件WeightedDegreeStringKernel.cpp576行定义。

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_vecnumber of vectors
vec_idxvector index
targettarget
num_suppvecnumber of support vectors
IDXIDX
alphasalphas
factorfactor

重载CKernel

在文件WeightedDegreeStringKernel.cpp915行定义。

void * compute_batch_helper ( void *  p ) [static]

helper for compute batch

参数:
pthread parameter

在文件WeightedDegreeStringKernel.cpp879行定义。

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

compute by subkernel

参数:
idxindex
subkernel_contribsubkernel contribution

重载CKernel

在文件WeightedDegreeStringKernel.h263行定义。

void compute_by_tree ( int32_t  idx,
float64_t LevelContrib 
)

compute by tree

参数:
idxindex
LevelContriblevel contribution
返回:
computed value

在文件WeightedDegreeStringKernel.cpp549行定义。

float64_t compute_by_tree ( int32_t  idx ) [protected]

compute by tree

参数:
idxindex
返回:
computed value

在文件WeightedDegreeStringKernel.cpp525行定义。

virtual float64_t compute_optimized ( int32_t  idx ) [virtual]

compute optimized

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

重载CKernel

在文件WeightedDegreeStringKernel.h178行定义。

float64_t compute_using_block ( char *  avec,
int32_t  alen,
char *  bvec,
int32_t  blen 
) [protected]

compute using block

参数:
avecvector a
alenlength of vector a
bvecvector b
blenlength of vector b
返回:
computed value

在文件WeightedDegreeStringKernel.cpp301行定义。

float64_t compute_with_mismatch ( char *  avec,
int32_t  alen,
char *  bvec,
int32_t  blen 
) [protected]

compute with mismatch

参数:
avecvector a
alenlength of vector a
bvecvector b
blenlength of vector b
返回:
computed value

在文件WeightedDegreeStringKernel.cpp273行定义。

float64_t compute_without_mismatch ( char *  avec,
int32_t  alen,
char *  bvec,
int32_t  blen 
) [protected]

compute without mismatch

参数:
avecvector a
alenlength of vector a
bvecvector b
blenlength of vector b
返回:
computed value

在文件WeightedDegreeStringKernel.cpp327行定义。

float64_t compute_without_mismatch_matrix ( char *  avec,
int32_t  alen,
char *  bvec,
int32_t  blen 
) [protected]

compute without mismatch matrix

参数:
avecvector a
alenlength of vector a
bvecvector b
blenlength of vector b
返回:
computed value

在文件WeightedDegreeStringKernel.cpp350行定义。

void create_empty_tries (  ) [protected]

create emtpy tries

在文件WeightedDegreeStringKernel.cpp138行定义。

bool delete_optimization (  ) [virtual]

delete optimization

返回:
if deleting was successful

重载CKernel

在文件WeightedDegreeStringKernel.cpp259行定义。

bool delete_position_weights (  )

delete position weights

返回:
if deleting was successful

在文件WeightedDegreeStringKernel.h544行定义。

int32_t get_degree (  ) const

get degree of WD kernel

返回:
degree of the kernel

在文件WeightedDegreeStringKernel.h114行定义。

int32_t get_degree (  )

get degree

返回:
degree

在文件WeightedDegreeStringKernel.h575行定义。

float64_t* get_degree_weights ( int32_t &  d,
int32_t &  len 
)

get degree weights

参数:
ddegree weights will be stored here
lennumber of degree weights will be stored here

在文件WeightedDegreeStringKernel.h405行定义。

virtual EKernelType get_kernel_type (  ) [virtual]

return what type of kernel we are

返回:
kernel type WEIGHTEDDEGREE

实现了CKernel

在文件WeightedDegreeStringKernel.h133行定义。

int32_t get_max_mismatch (  ) const

get the number of mismatches that are allowed in WD kernel computation

返回:
number of mismatches

在文件WeightedDegreeStringKernel.h124行定义。

int32_t get_max_mismatch (  )

get maximum mismatch

返回:
maximum mismatch

在文件WeightedDegreeStringKernel.h562行定义。

int32_t get_mkl_stepsize (  )

get MKL step size

返回:
MKL step size

在文件WeightedDegreeStringKernel.h611行定义。

virtual const char* get_name (  ) const [virtual]

return the kernel's name

返回:
name WeightedDegree

实现了CSGObject

在文件WeightedDegreeStringKernel.h139行定义。

virtual int32_t get_num_subkernels (  ) [virtual]

get number of subkernels

返回:
number of subkernels

重载CKernel

在文件WeightedDegreeStringKernel.h247行定义。

float64_t* get_position_weights ( int32_t &  len )

get position weights

参数:
lennumber of position weights will be stored here
返回:
position weights

在文件WeightedDegreeStringKernel.h440行定义。

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

get subkernel weights

参数:
num_weightsnumber of weights will be stored here
返回:
subkernel weights

重载CKernel

在文件WeightedDegreeStringKernel.h285行定义。

EWDKernType get_type (  ) const

get WD kernel weighting type

返回:
weighting type
参见:
EWDKernType

在文件WeightedDegreeStringKernel.h105行定义。

bool get_use_block_computation (  )

check if block computation is performed

返回:
if block computation is performed

在文件WeightedDegreeStringKernel.h592行定义。

float64_t* get_weights ( int32_t &  num_weights )

get weights

参数:
num_weightsnumber of weights will be stored here
返回:
weights

在文件WeightedDegreeStringKernel.h417行定义。

int32_t get_which_degree (  )

get which degree

返回:
which degree

在文件WeightedDegreeStringKernel.h628行定义。

bool init ( CFeatures l,
CFeatures r 
) [virtual]

initialize kernel

参数:
lfeatures of left-hand side
rfeatures of right-hand side
返回:
if initializing was successful

重载CStringKernel< char >

在文件WeightedDegreeStringKernel.cpp151行定义。

bool init_block_weights (  )

initialize block weights

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp851行定义。

bool init_block_weights_const (  )

initialize block weights constant

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp736行定义。

bool init_block_weights_cubicpoly (  )

initialize block weights cubic polynomial

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp781行定义。

bool init_block_weights_exp (  )

initialize block weights exponential

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp798行定义。

bool init_block_weights_external (  )

initialize block weights external

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp832行定义。

bool init_block_weights_from_wd (  )

initialize block weights from weighted degree

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp688行定义。

bool init_block_weights_from_wd_external (  )

initialize block weights from external weighted degree

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp708行定义。

bool init_block_weights_linear (  )

initialize block weights linear

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp750行定义。

bool init_block_weights_log (  )

initialize block weights logarithmic

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp815行定义。

bool init_block_weights_sqpoly (  )

initialize block weights squared polynomial

返回:
if initialization was successful

在文件WeightedDegreeStringKernel.cpp764行定义。

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

initialize optimization

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

重载CKernel

在文件WeightedDegreeStringKernel.h148行定义。

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

参数:
countcount
IDXIDX
alphasalphas
tree_numwhich tree
返回:
if initializing was successful

在文件WeightedDegreeStringKernel.cpp217行定义。

bool is_tree_initialized (  )

check if tree is initialized

返回:
if tree is initialized

在文件WeightedDegreeStringKernel.h398行定义。

void remove_lhs (  ) [protected, virtual]

remove lhs from kernel

重载CKernel

在文件WeightedDegreeStringKernel.cpp127行定义。

bool set_degree ( int32_t  deg )

set degree

参数:
degnew degree
返回:
if setting was successful

在文件WeightedDegreeStringKernel.h569行定义。

bool set_max_mismatch ( int32_t  max )

set maximum mismatch

参数:
maxnew maximum mismatch
返回:
if setting was successful

在文件WeightedDegreeStringKernel.cpp1019行定义。

bool set_mkl_stepsize ( int32_t  step )

set MKL steps ize

参数:
stepnew step size
返回:
if setting was successful

在文件WeightedDegreeStringKernel.h599行定义。

virtual bool set_normalizer ( CKernelNormalizer normalizer_ ) [virtual]

set the current kernel normalizer

返回:
if successful

重载CKernel

在文件WeightedDegreeStringKernel.h361行定义。

bool set_position_weights ( float64_t position_weights,
int32_t  len = 0 
)

set position weights

参数:
position_weightsnew position weights
lennumber of position weights
返回:
if setting was successful

在文件WeightedDegreeStringKernel.cpp659行定义。

void set_subkernel_weights ( float64_t weights2,
int32_t  num_weights2 
) [virtual]

set subkernel weights

参数:
weights2weights
num_weights2number of weights

重载CKernel

在文件WeightedDegreeStringKernel.h311行定义。

bool set_use_block_computation ( bool  block )

set if block computation shall be performed

参数:
blockif block computation shall be performed
返回:
if setting was successful

在文件WeightedDegreeStringKernel.h582行定义。

void set_wd_weights ( float64_t p_weights,
int32_t  d 
)

set wd weights

参数:
p_weightsnew eights
ddegree
返回:
if setting was successful

在文件WeightedDegreeStringKernel.h459行定义。

bool set_wd_weights_by_type ( EWDKernType  type )

set wd weights

参数:
typeweighted degree kernel type
返回:
if setting was successful

if we know a better weighting later on do a switch

在文件WeightedDegreeStringKernel.cpp582行定义。

bool set_weights ( float64_t weights,
int32_t  d,
int32_t  len 
)

set weights

参数:
weightsnew weights
ddegree
lennumber of weights

在文件WeightedDegreeStringKernel.cpp632行定义。

bool set_which_degree ( int32_t  which )

set which degree

参数:
whichwhich degree
返回:
if setting was successful

在文件WeightedDegreeStringKernel.h618行定义。


成员数据文档

CAlphabet* alphabet [protected]

alphabet of features

在文件WeightedDegreeStringKernel.h930行定义。

bool block_computation [protected]

if block computation is used

在文件WeightedDegreeStringKernel.h909行定义。

float64_t* block_weights [protected]

(internal) block weights

在文件WeightedDegreeStringKernel.h917行定义。

external block weights

在文件WeightedDegreeStringKernel.h914行定义。

int32_t degree [protected]

degree

在文件WeightedDegreeStringKernel.h896行定义。

bool initialized [protected]

if kernel is initialized

在文件WeightedDegreeStringKernel.h906行定义。

int32_t length [protected]

length

在文件WeightedDegreeStringKernel.h898行定义。

int32_t max_mismatch [protected]

maximum mismatch

在文件WeightedDegreeStringKernel.h901行定义。

int32_t mkl_stepsize [protected]

MKL step size

在文件WeightedDegreeStringKernel.h894行定义。

int32_t num_block_weights_external [protected]

number of external block weights

在文件WeightedDegreeStringKernel.h912行定义。

position weights

在文件WeightedDegreeStringKernel.h890行定义。

int32_t seq_length [protected]

sequence length

在文件WeightedDegreeStringKernel.h903行定义。

bool tree_initialized [protected]

if tree is initialized

在文件WeightedDegreeStringKernel.h927行定义。

CTrie<DNATrie>* tries [protected]

tries

在文件WeightedDegreeStringKernel.h924行定义。

EWDKernType type [protected]

WeightedDegree kernel type

在文件WeightedDegreeStringKernel.h919行定义。

float64_t* weights [protected]

degree*length weights length must match seq_length if != 0

在文件WeightedDegreeStringKernel.h888行定义。

float64_t* weights_buffer [protected]

weights buffer

在文件WeightedDegreeStringKernel.h892行定义。

int32_t which_degree [protected]

which degree

在文件WeightedDegreeStringKernel.h921行定义。


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

SHOGUN Machine Learning Toolbox - Documentation