The simple linear kernel (dot product). More...

Public Member Functions

 LinearKernel ()
 This constructor does nothing; the linear kernel has no parameters to store. More...

 
template
<
typename
Archive
>
void serialize (Archive &, const uint32_t)
 Serialize the kernel (it has no members... do nothing). More...

 

Static Public Member Functions

template
<
typename
VecTypeA
,
typename
VecTypeB
>
static double Evaluate (const VecTypeA &a, const VecTypeB &b)
 Simple evaluation of the dot product. More...

 

Detailed Description

The simple linear kernel (dot product).

For any two vectors $ x $ and $ y $,

\[ K(x, y) = x^T y \]

This kernel has no parameters and therefore the evaluation can be static.

Definition at line 32 of file linear_kernel.hpp.

Constructor & Destructor Documentation

◆ LinearKernel()

LinearKernel ( )
inline

This constructor does nothing; the linear kernel has no parameters to store.

Definition at line 39 of file linear_kernel.hpp.

Member Function Documentation

◆ Evaluate()

static double Evaluate ( const VecTypeA &  a,
const VecTypeB &  b 
)
inlinestatic

Simple evaluation of the dot product.

This evaluation uses Armadillo's dot() function.

Template Parameters
VecTypeAType of first vector (should be arma::vec or arma::sp_vec).
VecTypeBType of second vector (arma::vec / arma::sp_vec).
Parameters
aFirst vector.
bSecond vector.
Returns
K(a, b).

Definition at line 53 of file linear_kernel.hpp.

◆ serialize()

void serialize ( Archive &  ,
const uint32_t   
)
inline

Serialize the kernel (it has no members... do nothing).

Definition at line 60 of file linear_kernel.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/core/kernels/linear_kernel.hpp