CWeightedDegreePositionStringKernel Class Reference

Inheritance diagram for CWeightedDegreePositionStringKernel:

Inheritance graph
[legend]

List of all members.


Detailed Description

kernel WeightedDegreePositionString

Definition at line 22 of file WeightedDegreePositionStringKernel.h.


Public Member Functions

 CWeightedDegreePositionStringKernel (INT size, INT degree, INT max_mismatch=0, bool use_norm=true, INT mkl_stepsize=1)
 CWeightedDegreePositionStringKernel (INT size, DREAL *weights, INT degree, INT max_mismatch, INT *shift, INT shift_len, bool use_norm=true, INT mkl_stepsize=1)
 CWeightedDegreePositionStringKernel (CStringFeatures< CHAR > *l, CStringFeatures< CHAR > *r, INT degree)
virtual ~CWeightedDegreePositionStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
bool load_init (FILE *src)
bool save_init (FILE *dest)
virtual EKernelType get_kernel_type ()
virtual const CHARget_name ()
virtual bool init_optimization (INT p_count, INT *IDX, DREAL *alphas)
virtual bool init_optimization (INT count, INT *IDX, DREAL *alphas, INT tree_num, INT upto_tree=-1)
virtual bool delete_optimization ()
virtual DREAL compute_optimized (INT idx)
virtual void compute_batch (INT num_vec, INT *vec_idx, DREAL *target, INT num_suppvec, INT *IDX, DREAL *alphas, DREAL factor=1.0)
virtual void clear_normal ()
virtual void add_to_normal (INT idx, DREAL weight)
virtual INT get_num_subkernels ()
void compute_by_subkernel (INT idx, DREAL *subkernel_contrib)
const DREALget_subkernel_weights (INT &num_weights)
void set_subkernel_weights (DREAL *weights2, INT num_weights2)
DREALcompute_abs_weights (INT &len)
bool is_tree_initialized ()
INT get_max_mismatch ()
INT get_degree ()
DREAL get_normalization_const ()
DREALget_degree_weights (INT &d, INT &len)
DREALget_weights (INT &num_weights)
DREALget_position_weights (INT &len)
bool set_shifts (INT *shifts, INT len)
virtual bool set_weights (DREAL *weights, INT d, INT len=0)
virtual bool set_wd_weights ()
virtual bool set_position_weights (DREAL *position_weights, INT len=0)
bool set_position_weights_lhs (DREAL *pws, INT len, INT num)
bool set_position_weights_rhs (DREAL *pws, INT len, INT num)
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 delete_position_weights_lhs ()
bool delete_position_weights_rhs ()
bool get_use_normalization ()
virtual DREAL compute_by_tree (INT idx)
virtual void compute_by_tree (INT idx, DREAL *LevelContrib)
DREALcompute_scoring (INT max_degree, INT &num_feat, INT &num_sym, DREAL *target, INT num_suppvec, INT *IDX, DREAL *weights)
CHARcompute_consensus (INT &num_feat, INT num_suppvec, INT *IDX, DREAL *alphas)
DREALextract_w (INT max_degree, INT &num_feat, INT &num_sym, DREAL *w_result, INT num_suppvec, INT *IDX, DREAL *alphas)
DREALcompute_POIM (INT max_degree, INT &num_feat, INT &num_sym, DREAL *poim_result, INT num_suppvec, INT *IDX, DREAL *alphas, DREAL *distrib)
void prepare_POIM2 (DREAL *distrib, INT num_sym, INT num_feat)
void compute_POIM2 (INT max_degree, CSVM *svm)
void get_POIM2 (DREAL **poim, INT *result_len)
void cleanup_POIM2 ()
 cleanup POIM2
virtual EFeatureClass get_feature_class ()
virtual EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
DREAL kernel (INT idx_a, INT idx_b)
void get_kernel_matrix (DREAL **dst, INT *m, INT *n)
virtual DREALget_kernel_matrix_real (int &m, int &n, DREAL *target)
virtual SHORTREALget_kernel_matrix_shortreal (int &m, int &n, SHORTREAL *target)
bool load (CHAR *fname)
bool save (CHAR *fname)
CFeaturesget_lhs ()
CFeaturesget_rhs ()
INT get_num_vec_lhs ()
INT get_num_vec_rhs ()
bool has_features ()
virtual void remove_lhs_and_rhs ()
virtual void remove_rhs ()
 takes all necessary steps if the rhs is removed from kernel
void set_cache_size (INT size)
int get_cache_size ()
void list_kernel ()
bool has_property (EKernelProperty p)
EOptimizationType get_optimization_type ()
virtual void set_optimization_type (EOptimizationType t)
bool get_is_initialized ()
bool init_optimization_svm (CSVM *svm)
DREAL get_combined_kernel_weight ()
void set_combined_kernel_weight (double nw)
bool get_precompute_matrix ()
bool get_precompute_subkernel_matrix ()
virtual void set_precompute_matrix (bool flag, bool subkernel_flag)

Static Public Member Functions

static void * compute_batch_helper (void *p)

Static Public Attributes

static CParallel parallel
static CIO io
static CVersion version

Protected Member Functions

void create_empty_tries ()
virtual void add_example_to_tree (INT idx, DREAL weight)
void add_example_to_single_tree (INT idx, DREAL weight, INT tree_num)
virtual DREAL compute (INT idx_a, INT idx_b)
DREAL compute_with_mismatch (CHAR *avec, INT alen, CHAR *bvec, INT blen)
DREAL compute_without_mismatch (CHAR *avec, INT alen, CHAR *bvec, INT blen)
DREAL compute_without_mismatch_matrix (CHAR *avec, INT alen, CHAR *bvec, INT blen)
DREAL compute_without_mismatch_position_weights (CHAR *avec, DREAL *posweights_lhs, INT alen, CHAR *bvec, DREAL *posweights_rhs, INT blen)
virtual void remove_lhs ()
void set_property (EKernelProperty p)
void unset_property (EKernelProperty p)
void set_is_initialized (bool p_init)
void do_precompute_matrix ()
 matrix precomputation
void init_sqrt_diag (DREAL *v, INT num)

Protected Attributes

DREALweights
DREALposition_weights
DREALposition_weights_lhs
DREALposition_weights_rhs
bool * position_mask
DREALweights_buffer
INT mkl_stepsize
INT degree
INT length
INT max_mismatch
INT seq_length
INTshift
INT shift_len
INT max_shift
bool initialized
bool use_normalization
bool block_computation
DREAL normalization_const
INT num_block_weights_external
DREALblock_weights_external
DREALblock_weights
EWDKernType type
INT which_degree
CTrie< DNATrietries
CTrie< POIMTriepoim_tries
bool tree_initialized
bool use_poim_tries
DREALm_poim_distrib
DREALm_poim
INT m_poim_num_sym
INT m_poim_num_feat
INT m_poim_result_len
CAlphabetalphabet
INT cache_size
 cache_size in MB
KERNELCACHE_ELEMkernel_matrix
SHORTREALprecomputed_matrix
bool precompute_subkernel_matrix
bool precompute_matrix
CFeatureslhs
 feature vectors to occur on left hand side
CFeaturesrhs
 feature vectors to occur on right hand side
DREAL combined_kernel_weight
bool optimization_initialized
EOptimizationType opt_type
ULONG properties

Constructor & Destructor Documentation

CWeightedDegreePositionStringKernel::CWeightedDegreePositionStringKernel ( INT  size,
INT  degree,
INT  max_mismatch = 0,
bool  use_norm = true,
INT  mkl_stepsize = 1 
)

constructor

Parameters:
size cache size
degree degree
max_mismatch maximum mismatch
use_norm if normalization shall be used
mkl_stepsize MKL stepsize

Definition at line 47 of file WeightedDegreePositionStringKernel.cpp.

CWeightedDegreePositionStringKernel::CWeightedDegreePositionStringKernel ( INT  size,
DREAL weights,
INT  degree,
INT  max_mismatch,
INT shift,
INT  shift_len,
bool  use_norm = true,
INT  mkl_stepsize = 1 
)

constructor

Parameters:
size cache size
weights weights
degree degree
max_mismatch maximum mismatch
shift position shifts
shift_len number of shifts
use_norm if normalization shall be used
mkl_stepsize MKL stepsize

Definition at line 65 of file WeightedDegreePositionStringKernel.cpp.

CWeightedDegreePositionStringKernel::CWeightedDegreePositionStringKernel ( CStringFeatures< CHAR > *  l,
CStringFeatures< CHAR > *  r,
INT  degree 
)

constructor

Parameters:
l features of left-hand side
r features of right-hand side
degree degree

Definition at line 87 of file WeightedDegreePositionStringKernel.cpp.

CWeightedDegreePositionStringKernel::~CWeightedDegreePositionStringKernel (  )  [virtual]

Definition at line 108 of file WeightedDegreePositionStringKernel.cpp.


Member Function Documentation

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

initialize kernel

Parameters:
l features of left-hand side
r features of right-hand side
Returns:
if initializing was successful

Reimplemented from CStringKernel< ST >.

Definition at line 166 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 229 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::load_init ( FILE *  src  )  [virtual]

load kernel init_data

Parameters:
src file to load from
Returns:
if loading was successful

Implements CKernel.

Definition at line 250 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::save_init ( FILE *  dest  )  [virtual]

save kernel init_data

Parameters:
dest file to save to
Returns:
if saving was successful

Implements CKernel.

Definition at line 255 of file WeightedDegreePositionStringKernel.cpp.

virtual EKernelType CWeightedDegreePositionStringKernel::get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type WEIGHTEDDEGREEPOS

Implements CKernel.

Definition at line 92 of file WeightedDegreePositionStringKernel.h.

virtual const CHAR* CWeightedDegreePositionStringKernel::get_name (  )  [virtual]

return the kernel's name

Returns:
name WeightedDegreePos

Implements CKernel.

Definition at line 98 of file WeightedDegreePositionStringKernel.h.

virtual bool CWeightedDegreePositionStringKernel::init_optimization ( INT  p_count,
INT IDX,
DREAL alphas 
) [virtual]

initialize optimization

Parameters:
p_count count
IDX index
alphas alphas
Returns:
if initializing was successful

Reimplemented from CKernel.

Definition at line 107 of file WeightedDegreePositionStringKernel.h.

bool CWeightedDegreePositionStringKernel::init_optimization ( INT  count,
INT IDX,
DREAL alphas,
INT  tree_num,
INT  upto_tree = -1 
) [virtual]

initialize optimization do initialization for tree_num up to upto_tree, use tree_num=-1 to construct all trees

Parameters:
count count
IDX IDX
alphas alphas
tree_num which tree
upto_tree up to this tree
Returns:
if initializing was successful

Definition at line 260 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::delete_optimization (  )  [virtual]

delete optimization

Returns:
if deleting was successful

Reimplemented from CKernel.

Definition at line 305 of file WeightedDegreePositionStringKernel.cpp.

virtual DREAL CWeightedDegreePositionStringKernel::compute_optimized ( INT  idx  )  [virtual]

compute optimized

Parameters:
idx index to compute
Returns:
optimized value at given index

Reimplemented from CKernel.

Definition at line 137 of file WeightedDegreePositionStringKernel.h.

void * CWeightedDegreePositionStringKernel::compute_batch_helper ( void *  p  )  [static]

helper for compute batch

Parameters:
p thread parameter

Definition at line 1211 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::compute_batch ( INT  num_vec,
INT vec_idx,
DREAL target,
INT  num_suppvec,
INT IDX,
DREAL alphas,
DREAL  factor = 1.0 
) [virtual]

compute batch

Parameters:
num_vec number of vectors
vec_idx vector index
target target
num_suppvec number of support vectors
IDX IDX
alphas alphas
factor factor

Reimplemented from CKernel.

Definition at line 1256 of file WeightedDegreePositionStringKernel.cpp.

virtual void CWeightedDegreePositionStringKernel::clear_normal (  )  [virtual]

clear normal subkernel functionality

Reimplemented from CKernel.

Definition at line 167 of file WeightedDegreePositionStringKernel.h.

virtual void CWeightedDegreePositionStringKernel::add_to_normal ( INT  idx,
DREAL  weight 
) [virtual]

add to normal

Parameters:
idx where to add
weight what to add

Reimplemented from CKernel.

Definition at line 193 of file WeightedDegreePositionStringKernel.h.

virtual INT CWeightedDegreePositionStringKernel::get_num_subkernels (  )  [virtual]

get number of subkernels

Returns:
number of subkernels

Reimplemented from CKernel.

Definition at line 203 of file WeightedDegreePositionStringKernel.h.

void CWeightedDegreePositionStringKernel::compute_by_subkernel ( INT  idx,
DREAL subkernel_contrib 
) [virtual]

compute by subkernel

Parameters:
idx index
subkernel_contrib subkernel contribution

Reimplemented from CKernel.

Definition at line 217 of file WeightedDegreePositionStringKernel.h.

const DREAL* CWeightedDegreePositionStringKernel::get_subkernel_weights ( INT num_weights  )  [virtual]

get subkernel weights

Parameters:
num_weights number of weights will be stored here
Returns:
subkernel weights

Reimplemented from CKernel.

Definition at line 233 of file WeightedDegreePositionStringKernel.h.

void CWeightedDegreePositionStringKernel::set_subkernel_weights ( DREAL weights2,
INT  num_weights2 
) [virtual]

set subkernel weights

Parameters:
weights2 weights
num_weights2 number of weights

Reimplemented from CKernel.

Definition at line 255 of file WeightedDegreePositionStringKernel.h.

DREAL * CWeightedDegreePositionStringKernel::compute_abs_weights ( INT len  ) 

compute abs weights

Parameters:
len len
Returns:
computed abs weights

Definition at line 807 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::is_tree_initialized (  ) 

check if tree is initialized

Returns:
if tree is initialized

Definition at line 296 of file WeightedDegreePositionStringKernel.h.

INT CWeightedDegreePositionStringKernel::get_max_mismatch (  ) 

get maximum mismatch

Returns:
maximum mismatch

Definition at line 302 of file WeightedDegreePositionStringKernel.h.

INT CWeightedDegreePositionStringKernel::get_degree (  ) 

get degree

Returns:
the degree

Definition at line 308 of file WeightedDegreePositionStringKernel.h.

DREAL CWeightedDegreePositionStringKernel::get_normalization_const (  ) 

get normalization constant

Returns:
normalization constant

Definition at line 314 of file WeightedDegreePositionStringKernel.h.

DREAL* CWeightedDegreePositionStringKernel::get_degree_weights ( INT d,
INT len 
)

get degree weights

Parameters:
d degree weights will be stored here
len number of degree weights will be stored here

Definition at line 321 of file WeightedDegreePositionStringKernel.h.

DREAL* CWeightedDegreePositionStringKernel::get_weights ( INT num_weights  ) 

get weights

Parameters:
num_weights number of weights will be stored here
Returns:
weights

Definition at line 333 of file WeightedDegreePositionStringKernel.h.

DREAL* CWeightedDegreePositionStringKernel::get_position_weights ( INT len  ) 

get position weights

Parameters:
len number of position weights will be stored here
Returns:
position weights

Definition at line 352 of file WeightedDegreePositionStringKernel.h.

bool CWeightedDegreePositionStringKernel::set_shifts ( INT shifts,
INT  len 
)

set shifts

Parameters:
shifts new shifts
len number of shifts

Definition at line 812 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::set_weights ( DREAL weights,
INT  d,
INT  len = 0 
) [virtual]

set weights

Parameters:
weights new weights
d degree
len number of weights

Definition at line 874 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::set_wd_weights (  )  [virtual]

set wd weights

Returns:
if setting was successful

Definition at line 836 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::set_position_weights ( DREAL position_weights,
INT  len = 0 
) [virtual]

set position weights

Parameters:
position_weights new position weights
len number of position weights
Returns:
if setting was successful

Definition at line 896 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::set_position_weights_lhs ( DREAL pws,
INT  len,
INT  num 
)

set position weights for left-hand side

Parameters:
pws new position weights
len len
num num
Returns:
if setting was successful

Definition at line 929 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::set_position_weights_rhs ( DREAL pws,
INT  len,
INT  num 
)

set position weights for right-hand side

Parameters:
pws new position weights
len len
num num
Returns:
if setting was successful

Definition at line 971 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights (  ) 

initialize block weights

Returns:
if initialization was successful

Definition at line 1182 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_from_wd (  ) 

initialize block weights from weighted degree

Returns:
if initialization was successful

Definition at line 1021 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_from_wd_external (  ) 

initialize block weights from external weighted degree

Returns:
if initialization was successful

Definition at line 1039 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_const (  ) 

initialize block weights constant

Returns:
if initialization was successful

Definition at line 1067 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_linear (  ) 

initialize block weights linear

Returns:
if initialization was successful

Definition at line 1081 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_sqpoly (  ) 

initialize block weights squared polynomial

Returns:
if initialization was successful

Definition at line 1095 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_cubicpoly (  ) 

initialize block weights cubic polynomial

Returns:
if initialization was successful

Definition at line 1112 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_exp (  ) 

initialize block weights exponential

Returns:
if initialization was successful

Definition at line 1129 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_log (  ) 

initialize block weights logarithmic

Returns:
if initialization was successful

Definition at line 1146 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::init_block_weights_external (  ) 

initialize block weights external

Returns:
if initialization was successful

Definition at line 1163 of file WeightedDegreePositionStringKernel.cpp.

bool CWeightedDegreePositionStringKernel::delete_position_weights (  ) 

delete position weights

Returns:
if deleting was successful

Definition at line 469 of file WeightedDegreePositionStringKernel.h.

bool CWeightedDegreePositionStringKernel::delete_position_weights_lhs (  ) 

delete position weights left-hand side

Returns:
if deleting was successful

Definition at line 475 of file WeightedDegreePositionStringKernel.h.

bool CWeightedDegreePositionStringKernel::delete_position_weights_rhs (  ) 

delete position weights right-hand side

Returns:
if deleting was successful

Definition at line 481 of file WeightedDegreePositionStringKernel.h.

bool CWeightedDegreePositionStringKernel::get_use_normalization (  ) 

check if normalization is used

Returns:
if normalization is used

Definition at line 487 of file WeightedDegreePositionStringKernel.h.

DREAL CWeightedDegreePositionStringKernel::compute_by_tree ( INT  idx  )  [virtual]

compute by tree

Parameters:
idx index
Returns:
computed value

Definition at line 740 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::compute_by_tree ( INT  idx,
DREAL LevelContrib 
) [virtual]

compute by tree

Parameters:
idx index
LevelContrib level contribution

Definition at line 776 of file WeightedDegreePositionStringKernel.cpp.

DREAL * CWeightedDegreePositionStringKernel::compute_scoring ( INT  max_degree,
INT num_feat,
INT num_sym,
DREAL target,
INT  num_suppvec,
INT IDX,
DREAL weights 
)

compute positional scoring function, which assigns a weight per position, per symbol in the sequence

Parameters:
max_degree maximum degree
num_feat number of features
num_sym number of symbols
target target
num_suppvec number of support vectors
IDX IDX
weights weights
Returns:
computed scores

Definition at line 1364 of file WeightedDegreePositionStringKernel.cpp.

CHAR * CWeightedDegreePositionStringKernel::compute_consensus ( INT num_feat,
INT  num_suppvec,
INT IDX,
DREAL alphas 
)

compute consensus string

Parameters:
num_feat number of features
num_suppvec number of support vectors
IDX IDX
alphas alphas
Returns:
consensus string

Definition at line 1518 of file WeightedDegreePositionStringKernel.cpp.

DREAL * CWeightedDegreePositionStringKernel::extract_w ( INT  max_degree,
INT num_feat,
INT num_sym,
DREAL w_result,
INT  num_suppvec,
INT IDX,
DREAL alphas 
)

extract w

Parameters:
max_degree maximum degree
num_feat number of features
num_sym number of symbols
w_result w
num_suppvec number of support vectors
IDX IDX
alphas alphas
Returns:
w

Definition at line 1634 of file WeightedDegreePositionStringKernel.cpp.

DREAL * CWeightedDegreePositionStringKernel::compute_POIM ( INT  max_degree,
INT num_feat,
INT num_sym,
DREAL poim_result,
INT  num_suppvec,
INT IDX,
DREAL alphas,
DREAL distrib 
)

compute POIM

Parameters:
max_degree maximum degree
num_feat number of features
num_sym number of symbols
poim_result poim
num_suppvec number of support vectors
IDX IDX
alphas alphas
distrib distribution
Returns:
computed POIMs

Definition at line 1695 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::prepare_POIM2 ( DREAL distrib,
INT  num_sym,
INT  num_feat 
)

prepare POIM2

Parameters:
num_feat number of features
num_sym number of symbols
distrib distribution

Definition at line 1828 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::compute_POIM2 ( INT  max_degree,
CSVM svm 
)

compute POIM2

Parameters:
max_degree maximum degree
svm SVM

Definition at line 1839 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::get_POIM2 ( DREAL **  poim,
INT result_len 
)

get POIM2

Parameters:
poim POIMs (returned)
result_len (returned)

Definition at line 1873 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::cleanup_POIM2 (  ) 

cleanup POIM2

Definition at line 1881 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::create_empty_tries (  )  [protected]

create emtpy tries

Definition at line 147 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::add_example_to_tree ( INT  idx,
DREAL  weight 
) [protected, virtual]

add example to tree

Parameters:
idx index
weight weight

Definition at line 639 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::add_example_to_single_tree ( INT  idx,
DREAL  weight,
INT  tree_num 
) [protected]

add example to single tree

Parameters:
idx index
weight weight
tree_num which tree

Definition at line 690 of file WeightedDegreePositionStringKernel.cpp.

DREAL CWeightedDegreePositionStringKernel::compute ( INT  idx_a,
INT  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

Parameters:
idx_a index a
idx_b index b
Returns:
computed kernel function at indices a,b

Implements CKernel.

Definition at line 610 of file WeightedDegreePositionStringKernel.cpp.

DREAL CWeightedDegreePositionStringKernel::compute_with_mismatch ( CHAR avec,
INT  alen,
CHAR bvec,
INT  blen 
) [protected]

compute with mismatch

Parameters:
avec vector a
alen length of vector a
bvec vector b
blen length of vector b
Returns:
computed value

Definition at line 330 of file WeightedDegreePositionStringKernel.cpp.

DREAL CWeightedDegreePositionStringKernel::compute_without_mismatch ( CHAR avec,
INT  alen,
CHAR bvec,
INT  blen 
) [protected]

compute without mismatch

Parameters:
avec vector a
alen length of vector a
bvec vector b
blen length of vector b
Returns:
computed value

Definition at line 408 of file WeightedDegreePositionStringKernel.cpp.

DREAL CWeightedDegreePositionStringKernel::compute_without_mismatch_matrix ( CHAR avec,
INT  alen,
CHAR bvec,
INT  blen 
) [protected]

compute without mismatch matrix

Parameters:
avec vector a
alen length of vector a
bvec vector b
blen length of vector b
Returns:
computed value

Definition at line 471 of file WeightedDegreePositionStringKernel.cpp.

DREAL CWeightedDegreePositionStringKernel::compute_without_mismatch_position_weights ( CHAR avec,
DREAL posweights_lhs,
INT  alen,
CHAR bvec,
DREAL posweights_rhs,
INT  blen 
) [protected]

compute without mismatch position weights

Parameters:
avec vector a
posweights_lhs position weights left-hand side
alen length of vector a
bvec vector b
posweights_rhs position weights right-hand side
blen length of vector b
Returns:
computed value

Definition at line 533 of file WeightedDegreePositionStringKernel.cpp.

void CWeightedDegreePositionStringKernel::remove_lhs (  )  [protected, virtual]

remove lhs from kernel

Reimplemented from CKernel.

Definition at line 135 of file WeightedDegreePositionStringKernel.cpp.

template<class ST>
virtual EFeatureClass CStringKernel< ST >::get_feature_class (  )  [virtual, inherited]

return feature class the kernel can deal with

Returns:
feature class STRING

Implements CKernel.

Definition at line 63 of file StringKernel.h.

template<class ST>
virtual EFeatureType CStringKernel< ST >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

Returns:
templated feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

template<>
EFeatureType CStringKernel< DREAL >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 72 of file StringKernel.h.

template<>
EFeatureType CStringKernel< ULONG >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 74 of file StringKernel.h.

template<>
EFeatureType CStringKernel< INT >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 76 of file StringKernel.h.

template<>
EFeatureType CStringKernel< WORD >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 78 of file StringKernel.h.

template<>
EFeatureType CStringKernel< SHORT >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 80 of file StringKernel.h.

template<>
EFeatureType CStringKernel< BYTE >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 82 of file StringKernel.h.

template<>
EFeatureType CStringKernel< CHAR >::get_feature_type (  )  [virtual, inherited]

return feature type the kernel can deal with

abstract base method

Returns:
feature type

Implements CKernel.

Reimplemented in CCommUlongStringKernel, CCommWordStringKernel, and CWeightedCommWordStringKernel.

Definition at line 84 of file StringKernel.h.

DREAL CKernel::kernel ( INT  idx_a,
INT  idx_b 
) [inherited]

get kernel function for lhs feature vector a and rhs feature vector b

Parameters:
idx_a index of feature vector a
idx_b index of feature vector b
Returns:
computed kernel function

Definition at line 48 of file Kernel.h.

void CKernel::get_kernel_matrix ( DREAL **  dst,
INT m,
INT n 
) [inherited]

get kernel matrix

Parameters:
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.

DREAL * CKernel::get_kernel_matrix_real ( int &  m,
int &  n,
DREAL target 
) [virtual, inherited]

get kernel matrix real

Parameters:
m dimension m of matrix
n dimension n of matrix
target the kernel matrix
Returns:
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

Parameters:
m dimension m of matrix
n dimension n of matrix
target target for kernel matrix
Returns:
the kernel matrix

Reimplemented in CCustomKernel.

Definition at line 146 of file Kernel.cpp.

bool CKernel::load ( CHAR fname  )  [inherited]

load the kernel matrix

Parameters:
fname filename to load from
Returns:
if loading was succesful

Definition at line 322 of file Kernel.cpp.

bool CKernel::save ( CHAR fname  )  [inherited]

save kernel matrix

Parameters:
fname filename to save to
Returns:
if saving was successful

Definition at line 327 of file Kernel.cpp.

CFeatures* CKernel::get_lhs (  )  [inherited]

get left-hand side of features used in kernel

Returns:
features of left-hand side

Definition at line 164 of file Kernel.h.

CFeatures* CKernel::get_rhs (  )  [inherited]

get right-hand side of features used in kernel

Returns:
features of right-hand side

Definition at line 170 of file Kernel.h.

INT CKernel::get_num_vec_lhs (  )  [inherited]

get number of vectors of lhs features

Returns:
number of vectors of left-hand side

Definition at line 176 of file Kernel.h.

INT CKernel::get_num_vec_rhs (  )  [inherited]

get number of vectors of rhs features

Returns:
number of vectors of right-hand side

Definition at line 188 of file Kernel.h.

bool CKernel::has_features (  )  [inherited]

test whether features have been assigned to lhs and rhs

Returns:
true if features are assigned

Definition at line 200 of file Kernel.h.

void CKernel::remove_lhs_and_rhs (  )  [virtual, inherited]

remove lhs and rhs from kernel

Definition at line 358 of file Kernel.cpp.

void CKernel::remove_rhs (  )  [virtual, inherited]

takes all necessary steps if the rhs is removed from kernel

remove rhs from kernel

Reimplemented in CCombinedKernel, CCommUlongStringKernel, and CCommWordStringKernel.

Definition at line 379 of file Kernel.cpp.

void CKernel::set_cache_size ( INT  size  )  [inherited]

set the size of the kernel cache

Parameters:
size of kernel cache

Definition at line 249 of file Kernel.h.

int CKernel::get_cache_size (  )  [inherited]

return the size of the kernel cache

Returns:
size of kernel cache

Definition at line 259 of file Kernel.h.

void CKernel::list_kernel (  )  [inherited]

list kernel

Definition at line 389 of file Kernel.cpp.

bool CKernel::has_property ( EKernelProperty  p  )  [inherited]

check if kernel has given property

Parameters:
p kernel property
Returns:
if kernel has given property

Definition at line 271 of file Kernel.h.

EOptimizationType CKernel::get_optimization_type (  )  [inherited]

get optimization type

Returns:
optimization type

Definition at line 289 of file Kernel.h.

virtual void CKernel::set_optimization_type ( EOptimizationType  t  )  [virtual, inherited]

set optimization type

Parameters:
t optimization type to set

Reimplemented in CCombinedKernel.

Definition at line 295 of file Kernel.h.

bool CKernel::get_is_initialized (  )  [inherited]

check if optimization is initialized

Returns:
if optimization is initialized

Definition at line 301 of file Kernel.h.

bool CKernel::init_optimization_svm ( CSVM svm  )  [inherited]

initialize optimization

Parameters:
svm svm model
Returns:
if initializing was successful

Definition at line 644 of file Kernel.cpp.

DREAL CKernel::get_combined_kernel_weight (  )  [inherited]

get combined kernel weight

Returns:
combined kernel weight

Definition at line 346 of file Kernel.h.

void CKernel::set_combined_kernel_weight ( double  nw  )  [inherited]

set combined kernel weight

Parameters:
nw nw

Definition at line 352 of file Kernel.h.

bool CKernel::get_precompute_matrix (  )  [inherited]

get precompute matrix

Returns:
if matrix shall be precomputed

Definition at line 386 of file Kernel.h.

bool CKernel::get_precompute_subkernel_matrix (  )  [inherited]

get precompute subkernel matrix

Returns:
if subkernel matrix shall be precomputed

Definition at line 392 of file Kernel.h.

virtual void CKernel::set_precompute_matrix ( bool  flag,
bool  subkernel_flag 
) [virtual, inherited]

set precompute matrix

Parameters:
flag flag
subkernel_flag subkernel flag

Reimplemented in CCombinedKernel.

Definition at line 399 of file Kernel.h.

void CKernel::set_property ( EKernelProperty  p  )  [protected, inherited]

set property

Parameters:
p kernel property to set

Definition at line 416 of file Kernel.h.

void CKernel::unset_property ( EKernelProperty  p  )  [protected, inherited]

unset property

Parameters:
p kernel property to unset

Definition at line 425 of file Kernel.h.

void CKernel::set_is_initialized ( bool  p_init  )  [protected, inherited]

set is initialized

Parameters:
p_init if optimization shall be set to initialized

Definition at line 434 of file Kernel.h.

void CKernel::do_precompute_matrix (  )  [protected, inherited]

matrix precomputation

Definition at line 606 of file Kernel.cpp.

void CKernel::init_sqrt_diag ( DREAL v,
INT  num 
) [protected, inherited]

initialize sqrt diagonal

Parameters:
v v
num num

Definition at line 634 of file Kernel.cpp.


Member Data Documentation

weights

Definition at line 665 of file WeightedDegreePositionStringKernel.h.

position weights

Definition at line 667 of file WeightedDegreePositionStringKernel.h.

position weights left-hand side

Definition at line 669 of file WeightedDegreePositionStringKernel.h.

position weights right-hand side

Definition at line 671 of file WeightedDegreePositionStringKernel.h.

position mask

Definition at line 673 of file WeightedDegreePositionStringKernel.h.

weights buffer

Definition at line 676 of file WeightedDegreePositionStringKernel.h.

MKL stepsize

Definition at line 678 of file WeightedDegreePositionStringKernel.h.

degree

Definition at line 681 of file WeightedDegreePositionStringKernel.h.

length

Definition at line 683 of file WeightedDegreePositionStringKernel.h.

maximum mismatch

Definition at line 686 of file WeightedDegreePositionStringKernel.h.

length of sequence

Definition at line 688 of file WeightedDegreePositionStringKernel.h.

shifts

Definition at line 691 of file WeightedDegreePositionStringKernel.h.

length of shifts

Definition at line 693 of file WeightedDegreePositionStringKernel.h.

maximum shift

Definition at line 695 of file WeightedDegreePositionStringKernel.h.

if kernel is initialized

Definition at line 698 of file WeightedDegreePositionStringKernel.h.

if normalization is used

Definition at line 700 of file WeightedDegreePositionStringKernel.h.

if block computation is used

Definition at line 702 of file WeightedDegreePositionStringKernel.h.

normalization constant

Definition at line 705 of file WeightedDegreePositionStringKernel.h.

number of external block weights

Definition at line 708 of file WeightedDegreePositionStringKernel.h.

external block weights

Definition at line 710 of file WeightedDegreePositionStringKernel.h.

(internal) block weights

Definition at line 713 of file WeightedDegreePositionStringKernel.h.

WeightedDegree kernel type

Definition at line 715 of file WeightedDegreePositionStringKernel.h.

which degree

Definition at line 717 of file WeightedDegreePositionStringKernel.h.

tries

Definition at line 720 of file WeightedDegreePositionStringKernel.h.

POIM tries

Definition at line 722 of file WeightedDegreePositionStringKernel.h.

if tree is initialized

Definition at line 725 of file WeightedDegreePositionStringKernel.h.

makes add_example_to_tree (ONLY!) use POIMTrie

Definition at line 727 of file WeightedDegreePositionStringKernel.h.

temporary memory for the interface to the poim functions

Definition at line 730 of file WeightedDegreePositionStringKernel.h.

temporary memory for the interface to the poim functions

Definition at line 732 of file WeightedDegreePositionStringKernel.h.

number of symbols

Definition at line 735 of file WeightedDegreePositionStringKernel.h.

length of string (==num_feat)

Definition at line 737 of file WeightedDegreePositionStringKernel.h.

total size of poim array

Definition at line 739 of file WeightedDegreePositionStringKernel.h.

alphabet of features

Definition at line 742 of file WeightedDegreePositionStringKernel.h.

INT CKernel::cache_size [protected, inherited]

cache_size in MB

Definition at line 464 of file Kernel.h.

KERNELCACHE_ELEM* CKernel::kernel_matrix [protected, inherited]

this *COULD* store the whole kernel matrix usually not applicable / faster

Definition at line 470 of file Kernel.h.

SHORTREAL* CKernel::precomputed_matrix [protected, inherited]

precomputed matrix

Definition at line 473 of file Kernel.h.

bool CKernel::precompute_subkernel_matrix [protected, inherited]

if subkernel matrix shall be precomputed

Definition at line 475 of file Kernel.h.

bool CKernel::precompute_matrix [protected, inherited]

if matrix shall be precomputed

Definition at line 477 of file Kernel.h.

CFeatures* CKernel::lhs [protected, inherited]

feature vectors to occur on left hand side

Definition at line 480 of file Kernel.h.

CFeatures* CKernel::rhs [protected, inherited]

feature vectors to occur on right hand side

Definition at line 482 of file Kernel.h.

DREAL CKernel::combined_kernel_weight [protected, inherited]

combined kernel weight

Definition at line 485 of file Kernel.h.

bool CKernel::optimization_initialized [protected, inherited]

if optimization is initialized

Definition at line 488 of file Kernel.h.

EOptimizationType CKernel::opt_type [protected, inherited]

optimization type (currently FASTBUTMEMHUNGRY and SLOWBUTMEMEFFICIENT)

Definition at line 492 of file Kernel.h.

ULONG CKernel::properties [protected, inherited]

properties

Definition at line 495 of file Kernel.h.

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.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation