Definition at line 19 of file LinearWordKernel.h.
constructor
size | cache size | |
do_rescale | if rescaling shall be applied | |
scale | scaling factor |
Definition at line 17 of file LinearWordKernel.cpp.
CLinearWordKernel::CLinearWordKernel | ( | CWordFeatures * | l, | |
CWordFeatures * | r, | |||
bool | do_rescale = true , |
|||
DREAL | scale = 1. | |||
) |
constructor
l | features of left-hand side | |
r | features of right-hand side | |
do_rescale | if rescaling shall be applied | |
scale | scaling factor |
Definition at line 23 of file LinearWordKernel.cpp.
CLinearWordKernel::~CLinearWordKernel | ( | ) | [virtual] |
Definition at line 31 of file LinearWordKernel.cpp.
initialize kernel
l | features of left-hand side | |
r | features of right-hand side |
Reimplemented from CSimpleKernel< ST >.
Definition at line 36 of file LinearWordKernel.cpp.
void CLinearWordKernel::cleanup | ( | ) | [virtual] |
bool CLinearWordKernel::load_init | ( | FILE * | src | ) | [virtual] |
load kernel init_data
src | file to load from |
Implements CKernel.
Definition at line 71 of file LinearWordKernel.cpp.
bool CLinearWordKernel::save_init | ( | FILE * | dest | ) | [virtual] |
save kernel init_data
dest | file to save to |
Implements CKernel.
Definition at line 76 of file LinearWordKernel.cpp.
virtual EKernelType CLinearWordKernel::get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Implements CKernel.
Definition at line 72 of file LinearWordKernel.h.
virtual const CHAR* CLinearWordKernel::get_name | ( | ) | [virtual] |
return the kernel's name
Implements CKernel.
Definition at line 78 of file LinearWordKernel.h.
bool CLinearWordKernel::init_optimization | ( | INT | num_suppvec, | |
INT * | sv_idx, | |||
DREAL * | alphas | |||
) | [virtual] |
initialize optimization
num_suppvec | number of support vectors | |
sv_idx | support vector index | |
alphas | alphas |
Reimplemented from CKernel.
Definition at line 121 of file LinearWordKernel.cpp.
bool CLinearWordKernel::delete_optimization | ( | ) | [virtual] |
delete optimization
Reimplemented from CKernel.
Definition at line 149 of file LinearWordKernel.cpp.
compute optimized
idx | index to compute |
Reimplemented from CKernel.
Definition at line 158 of file LinearWordKernel.cpp.
void CLinearWordKernel::clear_normal | ( | ) | [virtual] |
add to normal
idx | where to add | |
weight | what to add |
Reimplemented from CKernel.
Definition at line 89 of file LinearWordKernel.cpp.
compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object
idx_a | index a | |
idx_b | index b |
Implements CKernel.
Definition at line 101 of file LinearWordKernel.cpp.
void CLinearWordKernel::init_rescale | ( | ) | [protected, virtual] |
initialize rescaling
Definition at line 48 of file LinearWordKernel.cpp.
virtual EFeatureClass CSimpleKernel< ST >::get_feature_class | ( | ) | [virtual, inherited] |
return feature class the kernel can deal with
Implements CKernel.
Definition at line 69 of file SimpleKernel.h.
virtual EFeatureType CSimpleKernel< ST >::get_feature_type | ( | ) | [virtual, inherited] |
EFeatureType CSimpleKernel< DREAL >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 79 of file SimpleKernel.h.
EFeatureType CSimpleKernel< ULONG >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 81 of file SimpleKernel.h.
EFeatureType CSimpleKernel< INT >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 83 of file SimpleKernel.h.
EFeatureType CSimpleKernel< WORD >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 85 of file SimpleKernel.h.
EFeatureType CSimpleKernel< SHORT >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 87 of file SimpleKernel.h.
EFeatureType CSimpleKernel< BYTE >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 89 of file SimpleKernel.h.
EFeatureType CSimpleKernel< CHAR >::get_feature_type | ( | ) | [virtual, inherited] |
return feature type the kernel can deal with
abstract base method
Implements CKernel.
Definition at line 91 of file SimpleKernel.h.
get kernel matrix
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.
get kernel matrix real
m | dimension m of matrix | |
n | dimension n of matrix | |
target | 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
m | dimension m of matrix | |
n | dimension n of matrix | |
target | target for kernel matrix |
Reimplemented in CCustomKernel.
Definition at line 146 of file Kernel.cpp.
bool CKernel::load | ( | CHAR * | fname | ) | [inherited] |
load the kernel matrix
fname | filename to load from |
Definition at line 322 of file Kernel.cpp.
bool CKernel::save | ( | CHAR * | fname | ) | [inherited] |
save kernel matrix
fname | filename to save to |
Definition at line 327 of file Kernel.cpp.
CFeatures* CKernel::get_lhs | ( | ) | [inherited] |
CFeatures* CKernel::get_rhs | ( | ) | [inherited] |
INT CKernel::get_num_vec_lhs | ( | ) | [inherited] |
INT CKernel::get_num_vec_rhs | ( | ) | [inherited] |
bool CKernel::has_features | ( | ) | [inherited] |
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_lhs | ( | ) | [virtual, inherited] |
remove lhs from kernel
Reimplemented in CCombinedKernel, CCommUlongStringKernel, CCommWordStringKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 370 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] |
int CKernel::get_cache_size | ( | ) | [inherited] |
void CKernel::list_kernel | ( | ) | [inherited] |
list kernel
Definition at line 389 of file Kernel.cpp.
bool CKernel::has_property | ( | EKernelProperty | p | ) | [inherited] |
EOptimizationType CKernel::get_optimization_type | ( | ) | [inherited] |
virtual void CKernel::set_optimization_type | ( | EOptimizationType | t | ) | [virtual, inherited] |
bool CKernel::get_is_initialized | ( | ) | [inherited] |
bool CKernel::init_optimization_svm | ( | CSVM * | svm | ) | [inherited] |
initialize optimization
svm | svm model |
Definition at line 644 of file Kernel.cpp.
void CKernel::compute_batch | ( | INT | num_vec, | |
INT * | vec_idx, | |||
DREAL * | target, | |||
INT | num_suppvec, | |||
INT * | IDX, | |||
DREAL * | alphas, | |||
DREAL | factor = 1.0 | |||
) | [virtual, inherited] |
computes output for a batch of examples in an optimized fashion (favorable if kernel supports it, i.e. has KP_BATCHEVALUATION. to the outputvector target (of length num_vec elements) the output for the examples enumerated in vec_idx are added. therefore make sure that it is initialized with ZERO. the following num_suppvec, IDX, alphas arguments are the number of support vectors, their indices and weights
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 568 of file Kernel.cpp.
DREAL CKernel::get_combined_kernel_weight | ( | ) | [inherited] |
void CKernel::set_combined_kernel_weight | ( | double | nw | ) | [inherited] |
INT CKernel::get_num_subkernels | ( | ) | [virtual, inherited] |
get number of subkernels
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 583 of file Kernel.cpp.
void CKernel::compute_by_subkernel | ( | INT | vector_idx, | |
DREAL * | subkernel_contrib | |||
) | [virtual, inherited] |
compute by subkernel
vector_idx | index | |
subkernel_contrib | subkernel contribution |
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 588 of file Kernel.cpp.
get subkernel weights
num_weights | number of weights will be stored here |
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 593 of file Kernel.cpp.
set subkernel weights
weights | subkernel weights | |
num_weights | number of weights |
Reimplemented in CCombinedKernel, CWeightedDegreePositionStringKernel, and CWeightedDegreeStringKernel.
Definition at line 599 of file Kernel.cpp.
bool CKernel::get_precompute_matrix | ( | ) | [inherited] |
bool CKernel::get_precompute_subkernel_matrix | ( | ) | [inherited] |
virtual void CKernel::set_precompute_matrix | ( | bool | flag, | |
bool | subkernel_flag | |||
) | [virtual, inherited] |
set precompute matrix
flag | flag | |
subkernel_flag | subkernel flag |
Reimplemented in CCombinedKernel.
void CKernel::set_property | ( | EKernelProperty | p | ) | [protected, inherited] |
void CKernel::unset_property | ( | EKernelProperty | p | ) | [protected, inherited] |
void CKernel::set_is_initialized | ( | bool | p_init | ) | [protected, inherited] |
void CKernel::do_precompute_matrix | ( | ) | [protected, inherited] |
double CLinearWordKernel::scale [protected] |
scaling factor
Definition at line 128 of file LinearWordKernel.h.
bool CLinearWordKernel::do_rescale [protected] |
if rescaling shall be applied
Definition at line 130 of file LinearWordKernel.h.
bool CLinearWordKernel::initialized [protected] |
if kernel is initialized
Definition at line 132 of file LinearWordKernel.h.
double* CLinearWordKernel::normal [protected] |
normal vector (used in case of optimized kernel)
Definition at line 134 of file LinearWordKernel.h.
INT CKernel::cache_size [protected, inherited] |
KERNELCACHE_ELEM* CKernel::kernel_matrix [protected, inherited] |
SHORTREAL* CKernel::precomputed_matrix [protected, inherited] |
bool CKernel::precompute_subkernel_matrix [protected, inherited] |
bool CKernel::precompute_matrix [protected, inherited] |
CFeatures* CKernel::lhs [protected, inherited] |
CFeatures* CKernel::rhs [protected, inherited] |
DREAL CKernel::combined_kernel_weight [protected, inherited] |
bool CKernel::optimization_initialized [protected, inherited] |
EOptimizationType CKernel::opt_type [protected, inherited] |
ULONG CKernel::properties [protected, inherited] |
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.