The simple polynomial kernel. More...
Public Member Functions | |
PolynomialKernel (const double degree=2.0, const double offset=0.0) | |
Construct the Polynomial Kernel with the given offset and degree. More... | |
const double & | Degree () const |
Get the degree of the polynomial. More... | |
double & | Degree () |
Modify the degree of the polynomial. More... | |
template < typename VecTypeA , typename VecTypeB > | |
double | Evaluate (const VecTypeA &a, const VecTypeB &b) const |
Simple evaluation of the dot product. More... | |
const double & | Offset () const |
Get the offset of the dot product of the arguments. More... | |
double & | Offset () |
Modify the offset of the dot product of the arguments. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the kernel. More... | |
The simple polynomial kernel.
For any two vectors , , and ,
Definition at line 28 of file polynomial_kernel.hpp.
|
inline |
Construct the Polynomial Kernel with the given offset and degree.
If the arguments are omitted, the default degree is 2 and the default offset is 0.
offset | Offset of the dot product of the arguments. |
degree | Degree of the polynomial. |
Definition at line 38 of file polynomial_kernel.hpp.
|
inline |
Get the degree of the polynomial.
Definition at line 61 of file polynomial_kernel.hpp.
|
inline |
Modify the degree of the polynomial.
Definition at line 63 of file polynomial_kernel.hpp.
|
inline |
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. |
Definition at line 55 of file polynomial_kernel.hpp.
|
inline |
Get the offset of the dot product of the arguments.
Definition at line 66 of file polynomial_kernel.hpp.
|
inline |
Modify the offset of the dot product of the arguments.
Definition at line 68 of file polynomial_kernel.hpp.
|
inline |
Serialize the kernel.
Definition at line 72 of file polynomial_kernel.hpp.