mlpack
|
Hyperbolic tangent kernel. More...
#include <hyperbolic_tangent_kernel.hpp>
Public Member Functions | |
HyperbolicTangentKernel () | |
This constructor sets the default scale to 1.0 and offset to 0.0. | |
HyperbolicTangentKernel (double scale, double offset) | |
Construct the hyperbolic tangent kernel with custom scale factor and offset. More... | |
template<typename VecTypeA , typename VecTypeB > | |
double | Evaluate (const VecTypeA &a, const VecTypeB &b) |
Evaluate the hyperbolic tangent kernel. More... | |
double | Scale () const |
Get scale factor. | |
double & | Scale () |
Modify scale factor. | |
double | Offset () const |
Get offset for the kernel. | |
double & | Offset () |
Modify offset for the kernel. | |
template<typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the kernel. | |
Hyperbolic tangent kernel.
For any two vectors \( x \), \( y \) and a given scale \( s \) and offset \( t \)
\[ K(x, y) = \tanh(s <x, y> + t) \]
|
inline |
Construct the hyperbolic tangent kernel with custom scale factor and offset.
scale | Scaling factor for <x, y>. |
offset | Kernel offset. |
|
inline |
Evaluate the hyperbolic tangent kernel.
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. |