SHOGUN v0.9.0
公有成员 | 保护成员 | 保护属性
CCommUlongStringKernel类参考

详细描述

The CommUlongString kernel may be used to compute the spectrum kernel from strings that have been mapped into unsigned 64bit integers.

These 64bit integers correspond to k-mers. To be applicable in this kernel they need to be sorted (e.g. via the SortUlongString pre-processor).

It basically uses the algorithm in the unix "comm" command (hence the name) to compute:

\[ k({\bf x},({\bf x'})= \Phi_k({\bf x})\cdot \Phi_k({\bf x'}) \]

where $\Phi_k$ maps a sequence ${\bf x}$ that consists of letters in $\Sigma$ to a feature vector of size $|\Sigma|^k$. In this feature vector each entry denotes how often the k-mer appears in that ${\bf x}$.

Note that this representation enables spectrum kernels of order 8 for 8bit alphabets (like binaries) and order 32 for 2-bit alphabets like DNA.

For this kernel the linadd speedups are implemented (though there is room for improvement here when a whole set of sequences is ADDed) using sorted lists.

在文件CommUlongStringKernel.h48行定义。

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

所有成员的列表。

公有成员

 CCommUlongStringKernel (int32_t size=10, bool use_sign=false)
 CCommUlongStringKernel (CStringFeatures< uint64_t > *l, CStringFeatures< uint64_t > *r, bool use_sign=false, int32_t size=10)
virtual ~CCommUlongStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
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)
void merge_dictionaries (int32_t &t, int32_t j, int32_t &k, uint64_t *vec, uint64_t *dic, float64_t *dic_weights, float64_t weight, int32_t vec_idx)
virtual void add_to_normal (int32_t idx, float64_t weight)
virtual void clear_normal ()
virtual void remove_lhs ()
virtual void remove_rhs ()
virtual EFeatureType get_feature_type ()
void get_dictionary (int32_t &dsize, uint64_t *&dict, float64_t *&dweights)

保护成员

float64_t compute (int32_t idx_a, int32_t idx_b)

保护属性

CDynamicArray< uint64_t > dictionary
CDynamicArray< float64_tdictionary_weights
bool use_sign

构造及析构函数文档

CCommUlongStringKernel ( int32_t  size = 10,
bool  use_sign = false 
)

constructor

参数:
sizecache size
use_signif sign shall be used

在文件CommUlongStringKernel.cpp19行定义。

CCommUlongStringKernel ( CStringFeatures< uint64_t > *  l,
CStringFeatures< uint64_t > *  r,
bool  use_sign = false,
int32_t  size = 10 
)

constructor

参数:
lfeatures of left-hand side
rfeatures of right-hand side
use_signif sign shall be used
sizecache size

在文件CommUlongStringKernel.cpp28行定义。

~CCommUlongStringKernel ( ) [virtual]

在文件CommUlongStringKernel.cpp39行定义。


成员函数文档

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

add to normal

参数:
idxwhere to add
weightwhat to add

重载CKernel

在文件CommUlongStringKernel.cpp145行定义。

void cleanup ( ) [virtual]

clean up kernel

重载CKernel

在文件CommUlongStringKernel.cpp73行定义。

void clear_normal ( ) [virtual]

clear normal

重载CKernel

在文件CommUlongStringKernel.cpp213行定义。

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

在文件CommUlongStringKernel.cpp80行定义。

float64_t compute_optimized ( int32_t  idx) [virtual]

compute optimized

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

重载CKernel

在文件CommUlongStringKernel.cpp257行定义。

bool delete_optimization ( ) [virtual]

delete optimization

返回:
if deleting was successful

重载CKernel

在文件CommUlongStringKernel.cpp248行定义。

void get_dictionary ( int32_t &  dsize,
uint64_t *&  dict,
float64_t *&  dweights 
)

get dictionary

参数:
dsizedictionary size will be stored in here
dictdictionary will be stored in here
dweightsdictionary weights will be stored in here

在文件CommUlongStringKernel.h183行定义。

virtual EFeatureType get_feature_type ( ) [virtual]

return feature type the kernel can deal with

返回:
feature type ULONG

重载CStringKernel< uint64_t >

在文件CommUlongStringKernel.h175行定义。

virtual EKernelType get_kernel_type ( ) [virtual]

return what type of kernel we are

返回:
kernel type COMMULONGSTRING

实现了CStringKernel< uint64_t >

在文件CommUlongStringKernel.h87行定义。

virtual const char* get_name ( void  ) const [virtual]

return the kernel's name

返回:
name CommUlongString

重载CStringKernel< uint64_t >

在文件CommUlongStringKernel.h93行定义。

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

initialize kernel

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

重载CStringKernel< uint64_t >

在文件CommUlongStringKernel.cpp67行定义。

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

initialize optimization

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

重载CKernel

在文件CommUlongStringKernel.cpp220行定义。

void merge_dictionaries ( int32_t &  t,
int32_t  j,
int32_t &  k,
uint64_t *  vec,
uint64_t *  dic,
float64_t dic_weights,
float64_t  weight,
int32_t  vec_idx 
)

merge dictionaries

参数:
tt
jj
kk
vecvector
dicdictionary
dic_weightsdictionary weights
weightweight
vec_idxvector index

在文件CommUlongStringKernel.h129行定义。

void remove_lhs ( ) [virtual]

remove lhs from kernel

重载CKernel

在文件CommUlongStringKernel.cpp44行定义。

void remove_rhs ( ) [virtual]

remove rhs from kernel

重载CKernel

在文件CommUlongStringKernel.cpp57行定义。


成员数据文档

CDynamicArray<uint64_t> dictionary [protected]

dictionary

在文件CommUlongStringKernel.h204行定义。

dictionary weights

在文件CommUlongStringKernel.h206行定义。

bool use_sign [protected]

if sign shall be used

在文件CommUlongStringKernel.h209行定义。


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

SHOGUN Machine Learning Toolbox - Documentation