mlpack
|
The simple linear kernel (dot product). More...
#include <linear_kernel.hpp>
Public Member Functions | |
LinearKernel () | |
This constructor does nothing; the linear kernel has no parameters to store. | |
template<typename Archive > | |
void | serialize (Archive &, const uint32_t) |
Serialize the kernel (it has no members... do nothing). | |
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... | |
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.
|
inlinestatic |
Simple evaluation of the dot product.
This evaluation uses Armadillo's dot() function.
VecTypeA | Type of first vector (should be arma::vec or arma::sp_vec). |
VecTypeB | Type of second vector (arma::vec / arma::sp_vec). |
a | First vector. |
b | Second vector. |