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

详细描述

The Custom Kernel allows for custom user provided kernel matrices.

For squared training matrices it allows to store only the upper triangle of the kernel to save memory: Full symmetric kernel matrices can be stored as is or can be internally converted into (or directly given in) upper triangle representation. Also note that values are stored as 32bit floats.

在文件CustomKernel.h29行定义。

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

所有成员的列表。

公有成员

 CCustomKernel ()
 CCustomKernel (CKernel *k)
 CCustomKernel (const float64_t *km, int32_t rows, int32_t cols)
 CCustomKernel (const float32_t *km, int32_t rows, int32_t cols)
virtual ~CCustomKernel ()
virtual bool dummy_init (int32_t rows, int32_t cols)
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual EFeatureType get_feature_type ()
virtual EFeatureClass get_feature_class ()
virtual const char * get_name () const
bool set_triangle_kernel_matrix_from_triangle (const float64_t *km, int32_t len)
bool set_triangle_kernel_matrix_from_triangle (const float32_t *km, int32_t len)
template<class T >
bool set_triangle_kernel_matrix_from_triangle_generic (const T *km, int64_t len)
bool set_triangle_kernel_matrix_from_full (const float64_t *km, int32_t rows, int32_t cols)
bool set_triangle_kernel_matrix_from_full (const float32_t *km, int32_t rows, int32_t cols)
template<class T >
bool set_triangle_kernel_matrix_from_full_generic (const T *km, int32_t rows, int32_t cols)
bool set_full_kernel_matrix_from_full (const float64_t *km, int32_t rows, int32_t cols)
bool set_full_kernel_matrix_from_full (const float32_t *km, int32_t rows, int32_t cols)
template<class T >
bool set_full_kernel_matrix_from_full_generic (const T *km, int32_t rows, int32_t cols)
virtual int32_t get_num_vec_lhs ()
virtual int32_t get_num_vec_rhs ()
virtual bool has_features ()

保护成员

virtual float64_t compute (int32_t row, int32_t col)

保护属性

float32_tkmatrix
int32_t num_rows
int32_t num_cols
bool upper_diagonal

构造及析构函数文档

default constructor

在文件CustomKernel.cpp27行定义。

constructor

compute custom kernel from given kernel matrix

参数:
kkernel matrix

在文件CustomKernel.cpp33行定义。

CCustomKernel ( const float64_t km,
int32_t  rows,
int32_t  cols 
)

constructor

sets full kernel matrix from full kernel matrix (from double precision floats)

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.cpp76行定义。

CCustomKernel ( const float32_t km,
int32_t  rows,
int32_t  cols 
)

constructor

sets full kernel matrix from full kernel matrix (from single precision floats)

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.cpp84行定义。

~CCustomKernel ( ) [virtual]

在文件CustomKernel.cpp92行定义。


成员函数文档

void cleanup ( ) [virtual]

clean up kernel

重载CKernel

在文件CustomKernel.cpp123行定义。

virtual float64_t compute ( int32_t  row,
int32_t  col 
) [protected, virtual]

compute kernel function

参数:
rowrow
colcol
返回:
computed kernel function

实现了CKernel

在文件CustomKernel.h360行定义。

bool dummy_init ( int32_t  rows,
int32_t  cols 
) [virtual]

initialize kernel with dummy features

Kernels always need feature objects assigned. As the custom kernel does not really require this it creates some magic dummy features that only know about the number of vectors

参数:
rowsfeatures of left-hand side
colsfeatures of right-hand side
返回:
if initializing was successful

在文件CustomKernel.cpp97行定义。

virtual EFeatureClass get_feature_class ( ) [virtual]

return feature class the kernel can deal with

返回:
feature class ANY

实现了CKernel

在文件CustomKernel.h111行定义。

virtual EFeatureType get_feature_type ( ) [virtual]

return feature type the kernel can deal with

返回:
feature type ANY

实现了CKernel

在文件CustomKernel.h105行定义。

virtual EKernelType get_kernel_type ( ) [virtual]

return what type of kernel we are

返回:
kernel type CUSTOM

实现了CKernel

在文件CustomKernel.h99行定义。

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

return the kernel's name

返回:
name Custom

实现了CSGObject

在文件CustomKernel.h117行定义。

virtual int32_t get_num_vec_lhs ( ) [virtual]

get number of vectors of lhs features

返回:
number of vectors of left-hand side

重载CKernel

在文件CustomKernel.h330行定义。

virtual int32_t get_num_vec_rhs ( ) [virtual]

get number of vectors of rhs features

返回:
number of vectors of right-hand side

重载CKernel

在文件CustomKernel.h339行定义。

virtual bool has_features ( ) [virtual]

test whether features have been assigned to lhs and rhs

返回:
true if features are assigned

重载CKernel

在文件CustomKernel.h348行定义。

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

initialize kernel

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

重载CKernel

在文件CustomKernel.cpp102行定义。

bool set_full_kernel_matrix_from_full ( const float32_t km,
int32_t  rows,
int32_t  cols 
)

set full kernel matrix from full kernel matrix

for float32's

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.h288行定义。

bool set_full_kernel_matrix_from_full ( const float64_t km,
int32_t  rows,
int32_t  cols 
)

set full kernel matrix from full kernel matrix

for float64's

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.h273行定义。

bool set_full_kernel_matrix_from_full_generic ( const T *  km,
int32_t  rows,
int32_t  cols 
)

set full kernel matrix from full kernel matrix

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.h302行定义。

bool set_triangle_kernel_matrix_from_full ( const float64_t km,
int32_t  rows,
int32_t  cols 
)

set kernel matrix (only elements from upper triangle) from squared matrix

for float64's

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.h207行定义。

bool set_triangle_kernel_matrix_from_full ( const float32_t km,
int32_t  rows,
int32_t  cols 
)

set kernel matrix (only elements from upper triangle) from squared matrix

for float32's

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.h223行定义。

bool set_triangle_kernel_matrix_from_full_generic ( const T *  km,
int32_t  rows,
int32_t  cols 
)

set kernel matrix (only elements from upper triangle) from squared matrix

参数:
kmkernel matrix
rowsnumber of rows in matrix
colsnumber of cols in matrix
返回:
if setting was successful

在文件CustomKernel.h238行定义。

bool set_triangle_kernel_matrix_from_triangle ( const float32_t km,
int32_t  len 
)

set kernel matrix (only elements from upper triangle) from elements of upper triangle (concat'd), including the main diagonal

small variant for floats32's, triangle needs to have less than 2**32 elements

参数:
kmkernel matrix
lendenotes the size of the array and should match len=cols*(cols+1)/2
返回:
if setting was successful

在文件CustomKernel.h145行定义。

bool set_triangle_kernel_matrix_from_triangle ( const float64_t km,
int32_t  len 
)

set kernel matrix (only elements from upper triangle) from elements of upper triangle (concat'd), including the main diagonal

small variant for floats64's, triangle needs to have less than 2**32 elements

参数:
kmkernel matrix
lendenotes the size of the array and should match len=cols*(cols+1)/2
返回:
if setting was successful

在文件CustomKernel.h129行定义。

bool set_triangle_kernel_matrix_from_triangle_generic ( const T *  km,
int64_t  len 
)

set kernel matrix (only elements from upper triangle) from elements of upper triangle (concat'd), including the main diagonal

big variant, allowing the triangle to have more than 2**31-1 elements

参数:
kmkernel matrix
lendenotes the size of the array and should match len=cols*(cols+1)/2
返回:
if setting was successful

在文件CustomKernel.h162行定义。


成员数据文档

float32_t* kmatrix [protected]

kernel matrix

在文件CustomKernel.h390行定义。

int32_t num_cols [protected]

number of columns

在文件CustomKernel.h394行定义。

int32_t num_rows [protected]

number of rows

在文件CustomKernel.h392行定义。

bool upper_diagonal [protected]

upper diagonal

在文件CustomKernel.h396行定义。


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

SHOGUN Machine Learning Toolbox - Documentation