CWeightedDegreeStringKernel Class Reference

Inheritance diagram for CWeightedDegreeStringKernel:

Inheritance graph
[legend]

List of all members.


Detailed Description

kernel WeightedDegreeString

Definition at line 21 of file WeightedDegreeStringKernel.h.


Public Member Functions

 CWeightedDegreeStringKernel (INT degree, EWDKernType type=E_WD)
 CWeightedDegreeStringKernel (DREAL *weights, INT degree)
 CWeightedDegreeStringKernel (CStringFeatures< CHAR > *l, CStringFeatures< CHAR > *r, INT degree)
virtual ~CWeightedDegreeStringKernel ()
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 count, INT *IDX, DREAL *alphas)
virtual bool init_optimization (INT count, INT *IDX, DREAL *alphas, INT tree_num)
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)
void compute_by_tree (INT idx, DREAL *LevelContrib)
bool is_tree_initialized ()
DREAL get_normalization_const ()
DREALget_degree_weights (INT &d, INT &len)
DREALget_weights (INT &num_weights)
DREALget_position_weights (INT &len)
bool set_wd_weights_by_type (EWDKernType type)
void set_wd_weights (DREAL *p_weights, INT d)
bool set_weights (DREAL *weights, INT d, INT len)
bool set_position_weights (DREAL *position_weights, INT 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 (INT max)
INT get_max_mismatch ()
bool set_degree (INT deg)
INT get_degree ()
bool set_use_normalization (bool opt)
bool get_use_normalization ()
bool set_use_block_computation (bool block)
bool get_use_block_computation ()
bool set_mkl_stepsize (INT step)
INT get_mkl_stepsize ()
bool set_which_degree (INT which)
INT get_which_degree ()
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 ()
void add_example_to_tree (INT idx, DREAL weight)
void add_example_to_single_tree (INT idx, DREAL weight, INT tree_num)
void add_example_to_tree_mismatch (INT idx, DREAL weight)
void add_example_to_single_tree_mismatch (INT idx, DREAL weight, INT tree_num)
void add_example_to_tree_mismatch_recursion (DNATrie *tree, DREAL alpha, INT *vec, INT len_rem, INT depth_rec, INT mismatch_rec)
DREAL compute_by_tree (INT idx)
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_using_block (CHAR *avec, INT alen, CHAR *bvec, 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
DREALweights_buffer
INT mkl_stepsize
INT degree
INT length
INT max_mismatch
INT seq_length
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< DNATrie > * tries
bool tree_initialized
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

CWeightedDegreeStringKernel::CWeightedDegreeStringKernel ( INT  degree,
EWDKernType  type = E_WD 
)

constructor

Parameters:
degree degree
type weighted degree kernel type

Definition at line 41 of file WeightedDegreeStringKernel.cpp.

CWeightedDegreeStringKernel::CWeightedDegreeStringKernel ( DREAL weights,
INT  degree 
)

constructor

Parameters:
weights kernel's weights
degree degree

Definition at line 59 of file WeightedDegreeStringKernel.cpp.

CWeightedDegreeStringKernel::CWeightedDegreeStringKernel ( 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 78 of file WeightedDegreeStringKernel.cpp.

CWeightedDegreeStringKernel::~CWeightedDegreeStringKernel (  )  [virtual]

Definition at line 94 of file WeightedDegreeStringKernel.cpp.


Member Function Documentation

bool CWeightedDegreeStringKernel::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 135 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::cleanup (  )  [virtual]

clean up kernel

Reimplemented from CKernel.

Definition at line 183 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::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 208 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::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 213 of file WeightedDegreeStringKernel.cpp.

virtual EKernelType CWeightedDegreeStringKernel::get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type WEIGHTEDDEGREE

Implements CKernel.

Definition at line 78 of file WeightedDegreeStringKernel.h.

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

return the kernel's name

Returns:
name WeightedDegree

Implements CKernel.

Definition at line 84 of file WeightedDegreeStringKernel.h.

virtual bool CWeightedDegreeStringKernel::init_optimization ( INT  count,
INT IDX,
DREAL alphas 
) [virtual]

initialize optimization

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

Reimplemented from CKernel.

Definition at line 93 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::init_optimization ( INT  count,
INT IDX,
DREAL alphas,
INT  tree_num 
) [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
Returns:
if initializing was successful

Definition at line 219 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::delete_optimization (  )  [virtual]

delete optimization

Returns:
if deleting was successful

Reimplemented from CKernel.

Definition at line 262 of file WeightedDegreeStringKernel.cpp.

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

compute optimized

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

Reimplemented from CKernel.

Definition at line 122 of file WeightedDegreeStringKernel.h.

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

helper for compute batch

Parameters:
p thread parameter

Definition at line 848 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::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 883 of file WeightedDegreeStringKernel.cpp.

virtual void CWeightedDegreeStringKernel::clear_normal (  )  [virtual]

clear normal subkernel functionality

Reimplemented from CKernel.

Definition at line 153 of file WeightedDegreeStringKernel.h.

virtual void CWeightedDegreeStringKernel::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 167 of file WeightedDegreeStringKernel.h.

virtual INT CWeightedDegreeStringKernel::get_num_subkernels (  )  [virtual]

get number of subkernels

Returns:
number of subkernels

Reimplemented from CKernel.

Definition at line 181 of file WeightedDegreeStringKernel.h.

void CWeightedDegreeStringKernel::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 195 of file WeightedDegreeStringKernel.h.

const DREAL* CWeightedDegreeStringKernel::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 211 of file WeightedDegreeStringKernel.h.

void CWeightedDegreeStringKernel::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 233 of file WeightedDegreeStringKernel.h.

DREAL * CWeightedDegreeStringKernel::compute_abs_weights ( INT len  ) 

compute abs weights

Parameters:
len len
Returns:
computed abs weights

Definition at line 551 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::compute_by_tree ( INT  idx,
DREAL LevelContrib 
)

compute by tree

Parameters:
idx index
LevelContrib level contribution
Returns:
computed value

Definition at line 531 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::is_tree_initialized (  ) 

check if tree is initialized

Returns:
if tree is initialized

Definition at line 294 of file WeightedDegreeStringKernel.h.

DREAL CWeightedDegreeStringKernel::get_normalization_const (  ) 

get normalization constant

Returns:
normalization constant

Definition at line 300 of file WeightedDegreeStringKernel.h.

DREAL* CWeightedDegreeStringKernel::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 307 of file WeightedDegreeStringKernel.h.

DREAL* CWeightedDegreeStringKernel::get_weights ( INT num_weights  ) 

get weights

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

Definition at line 319 of file WeightedDegreeStringKernel.h.

DREAL* CWeightedDegreeStringKernel::get_position_weights ( INT len  ) 

get position weights

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

Definition at line 338 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_wd_weights_by_type ( EWDKernType  type  ) 

set wd weights

Parameters:
type weighted degree kernel type
Returns:
if setting was successful

if we know a better weighting later on do a switch

Definition at line 557 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::set_wd_weights ( DREAL p_weights,
INT  d 
)

set wd weights

Parameters:
p_weights new eights
d degree
Returns:
if setting was successful

Definition at line 357 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_weights ( DREAL weights,
INT  d,
INT  len 
)

set weights

Parameters:
weights new weights
d degree
len number of weights

Definition at line 607 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::set_position_weights ( DREAL position_weights,
INT  len = 0 
)

set position weights

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

Definition at line 631 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights (  ) 

initialize block weights

Returns:
if initialization was successful

Definition at line 820 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_from_wd (  ) 

initialize block weights from weighted degree

Returns:
if initialization was successful

Definition at line 659 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_from_wd_external (  ) 

initialize block weights from external weighted degree

Returns:
if initialization was successful

Definition at line 677 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_const (  ) 

initialize block weights constant

Returns:
if initialization was successful

Definition at line 705 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_linear (  ) 

initialize block weights linear

Returns:
if initialization was successful

Definition at line 719 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_sqpoly (  ) 

initialize block weights squared polynomial

Returns:
if initialization was successful

Definition at line 733 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_cubicpoly (  ) 

initialize block weights cubic polynomial

Returns:
if initialization was successful

Definition at line 750 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_exp (  ) 

initialize block weights exponential

Returns:
if initialization was successful

Definition at line 767 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_log (  ) 

initialize block weights logarithmic

Returns:
if initialization was successful

Definition at line 784 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::init_block_weights_external (  ) 

initialize block weights external

Returns:
if initialization was successful

Definition at line 801 of file WeightedDegreeStringKernel.cpp.

bool CWeightedDegreeStringKernel::delete_position_weights (  ) 

delete position weights

Returns:
if deleting was successful

Definition at line 442 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_max_mismatch ( INT  max  ) 

set maximum mismatch

Parameters:
max new maximum mismatch
Returns:
if setting was succesful

Definition at line 982 of file WeightedDegreeStringKernel.cpp.

INT CWeightedDegreeStringKernel::get_max_mismatch (  ) 

get maximum mismatch

Returns:
maximum mismatch

Definition at line 455 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_degree ( INT  deg  ) 

set degree

Parameters:
deg new degree
Returns:
if setting was successful

Definition at line 462 of file WeightedDegreeStringKernel.h.

INT CWeightedDegreeStringKernel::get_degree (  ) 

get degree

Returns:
degree

Definition at line 468 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_use_normalization ( bool  opt  ) 

set if normalization shall be used

Parameters:
opt if normalization shall be used
Returns:
if setting was successful

Definition at line 475 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::get_use_normalization (  ) 

check if normalization is used

Returns:
if normalization is used

Definition at line 481 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_use_block_computation ( bool  block  ) 

set if block computation shall be performed

Parameters:
block if block computation shall be performed
Returns:
if setting was successful

Definition at line 488 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::get_use_block_computation (  ) 

check if block computation is performed

Returns:
if block computation is performed

Definition at line 494 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_mkl_stepsize ( INT  step  ) 

set MKL steps ize

Parameters:
step new step size
Returns:
if setting was successful

Definition at line 501 of file WeightedDegreeStringKernel.h.

INT CWeightedDegreeStringKernel::get_mkl_stepsize (  ) 

get MKL step size

Returns:
MKL step size

Definition at line 507 of file WeightedDegreeStringKernel.h.

bool CWeightedDegreeStringKernel::set_which_degree ( INT  which  ) 

set which degree

Parameters:
which which degree
Returns:
if setting was successful

Definition at line 514 of file WeightedDegreeStringKernel.h.

INT CWeightedDegreeStringKernel::get_which_degree (  ) 

get which degree

Returns:
which degree

Definition at line 520 of file WeightedDegreeStringKernel.h.

void CWeightedDegreeStringKernel::create_empty_tries (  )  [protected]

create emtpy tries

Definition at line 124 of file WeightedDegreeStringKernel.cpp.

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

add example to tree

Parameters:
idx index
weight weight

Definition at line 396 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::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 439 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::add_example_to_tree_mismatch ( INT  idx,
DREAL  weight 
) [protected]

add example to tree mismatch

Parameters:
idx index
weight weight

Definition at line 460 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::add_example_to_single_tree_mismatch ( INT  idx,
DREAL  weight,
INT  tree_num 
) [protected]

add example to single tree mismatch

Parameters:
idx index
weight weight
tree_num which tree

Definition at line 484 of file WeightedDegreeStringKernel.cpp.

void CWeightedDegreeStringKernel::add_example_to_tree_mismatch_recursion ( DNATrie tree,
DREAL  alpha,
INT vec,
INT  len_rem,
INT  depth_rec,
INT  mismatch_rec 
) [protected]

add example to tree mismatch recursion

Parameters:
tree tree
alpha alpha
vec vector
len_rem length of rem
depth_rec depth rec
mismatch_rec mismatch rec

DREAL CWeightedDegreeStringKernel::compute_by_tree ( INT  idx  )  [protected]

compute by tree

Parameters:
idx index
Returns:
computed value

Definition at line 509 of file WeightedDegreeStringKernel.cpp.

DREAL CWeightedDegreeStringKernel::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 373 of file WeightedDegreeStringKernel.cpp.

DREAL CWeightedDegreeStringKernel::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 276 of file WeightedDegreeStringKernel.cpp.

DREAL CWeightedDegreeStringKernel::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 328 of file WeightedDegreeStringKernel.cpp.

DREAL CWeightedDegreeStringKernel::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 350 of file WeightedDegreeStringKernel.cpp.

DREAL CWeightedDegreeStringKernel::compute_using_block ( CHAR avec,
INT  alen,
CHAR bvec,
INT  blen 
) [protected]

compute using block

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

Definition at line 303 of file WeightedDegreeStringKernel.cpp.

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

remove lhs from kernel

Reimplemented from CKernel.

Definition at line 112 of file WeightedDegreeStringKernel.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

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

Definition at line 637 of file WeightedDegreeStringKernel.h.

position weights

Definition at line 639 of file WeightedDegreeStringKernel.h.

weights buffer

Definition at line 641 of file WeightedDegreeStringKernel.h.

MKL step size

Definition at line 643 of file WeightedDegreeStringKernel.h.

degree

Definition at line 645 of file WeightedDegreeStringKernel.h.

length

Definition at line 647 of file WeightedDegreeStringKernel.h.

maximum mismatch

Definition at line 650 of file WeightedDegreeStringKernel.h.

sequence length

Definition at line 652 of file WeightedDegreeStringKernel.h.

if kernel is initialized

Definition at line 655 of file WeightedDegreeStringKernel.h.

if normalization is used

Definition at line 657 of file WeightedDegreeStringKernel.h.

if block computation is used

Definition at line 659 of file WeightedDegreeStringKernel.h.

normalization constant

Definition at line 662 of file WeightedDegreeStringKernel.h.

number of external block weights

Definition at line 665 of file WeightedDegreeStringKernel.h.

external block weights

Definition at line 667 of file WeightedDegreeStringKernel.h.

(internal) block weights

Definition at line 670 of file WeightedDegreeStringKernel.h.

WeightedDegree kernel type

Definition at line 672 of file WeightedDegreeStringKernel.h.

which degree

Definition at line 674 of file WeightedDegreeStringKernel.h.

tries

Definition at line 677 of file WeightedDegreeStringKernel.h.

if tree is initialized

Definition at line 680 of file WeightedDegreeStringKernel.h.

alphabet of features

Definition at line 683 of file WeightedDegreeStringKernel.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