CTensorProductPairKernel Class Reference


Detailed Description

Computes the Tensor Product Pair Kernel (TPPK).

Formally, it computes

\[ k_{\mbox{tppk}}(({\bf a},{\bf b}), ({\bf c},{\bf d}))= k({\bf a}, {\bf c})\cdot k({\bf b}, {\bf c}) + k({\bf a},{\bf d})\cdot k({\bf b}, {\bf c}) \]

It is defined on pairs of inputs and a subkernel $k$. The subkernel has to be given on initialization. The pairs are specified via indizes (ab)using 2-dimensional integer features.

Its feature space $\Phi_{\mbox{tppk}}$ is the tensor product of the feature spaces of the subkernel $k(.,.)$ on its input.

It is often used in bioinformatics, e.g., to predict protein-protein interactions.

Definition at line 35 of file TensorProductPairKernel.h.

Inheritance diagram for CTensorProductPairKernel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CTensorProductPairKernel (int32_t size, CKernel *subkernel)
 CTensorProductPairKernel (CSimpleFeatures< int32_t > *l, CSimpleFeatures< int32_t > *r, CKernel *subkernel)
virtual ~CTensorProductPairKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual bool load_init (FILE *src)
virtual bool save_init (FILE *dest)
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

CKernelsubkernel

Constructor & Destructor Documentation

CTensorProductPairKernel::CTensorProductPairKernel ( int32_t  size,
CKernel subkernel 
)

constructor

Parameters:
size cache size
subkernel the subkernel

Definition at line 17 of file TensorProductPairKernel.cpp.

CTensorProductPairKernel::CTensorProductPairKernel ( CSimpleFeatures< int32_t > *  l,
CSimpleFeatures< int32_t > *  r,
CKernel subkernel 
)

constructor

Parameters:
l features of left-hand side
r features of right-hand side
subkernel the subkernel

Definition at line 23 of file TensorProductPairKernel.cpp.

CTensorProductPairKernel::~CTensorProductPairKernel (  )  [virtual]

Definition at line 30 of file TensorProductPairKernel.cpp.


Member Function Documentation

float64_t CTensorProductPairKernel::compute ( int32_t  idx_a,
int32_t  idx_b 
) [protected, virtual]

compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object

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

Implements CKernel.

Definition at line 53 of file TensorProductPairKernel.cpp.

virtual EKernelType CTensorProductPairKernel::get_kernel_type (  )  [virtual]

return what type of kernel we are

Returns:
kernel type TPPK

Implements CKernel.

Definition at line 81 of file TensorProductPairKernel.h.

virtual const char* CTensorProductPairKernel::get_name (  )  const [virtual]

return the kernel's name

Returns:
name TPPK

Implements CSGObject.

Definition at line 87 of file TensorProductPairKernel.h.

bool CTensorProductPairKernel::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 CSimpleKernel< int32_t >.

Definition at line 36 of file TensorProductPairKernel.cpp.

bool CTensorProductPairKernel::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 43 of file TensorProductPairKernel.cpp.

bool CTensorProductPairKernel::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 48 of file TensorProductPairKernel.cpp.


Member Data Documentation

the subkernel

Definition at line 102 of file TensorProductPairKernel.h.


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

SHOGUN Machine Learning Toolbox - Documentation