HyperbolicTangentKernel Class Reference

Hyperbolic tangent kernel. More...

Public Member Functions

 HyperbolicTangentKernel ()
 This constructor sets the default scale to 1.0 and offset to 0.0. More...

 
 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 Offset () const
 Get offset for the kernel. More...

 
double & Offset ()
 Modify offset for the kernel. More...

 
double Scale () const
 Get scale factor. More...

 
double & Scale ()
 Modify scale factor. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the kernel. More...

 

Detailed Description

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) \]

Definition at line 28 of file hyperbolic_tangent_kernel.hpp.

Constructor & Destructor Documentation

◆ HyperbolicTangentKernel() [1/2]

This constructor sets the default scale to 1.0 and offset to 0.0.

Definition at line 34 of file hyperbolic_tangent_kernel.hpp.

◆ HyperbolicTangentKernel() [2/2]

HyperbolicTangentKernel ( double  scale,
double  offset 
)
inline

Construct the hyperbolic tangent kernel with custom scale factor and offset.

Parameters
scaleScaling factor for <x, y>.
offsetKernel offset.

Definition at line 44 of file hyperbolic_tangent_kernel.hpp.

Member Function Documentation

◆ Evaluate()

double Evaluate ( const VecTypeA &  a,
const VecTypeB &  b 
)
inline

Evaluate the hyperbolic tangent kernel.

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 60 of file hyperbolic_tangent_kernel.hpp.

◆ Offset() [1/2]

double Offset ( ) const
inline

Get offset for the kernel.

Definition at line 71 of file hyperbolic_tangent_kernel.hpp.

◆ Offset() [2/2]

double& Offset ( )
inline

Modify offset for the kernel.

Definition at line 73 of file hyperbolic_tangent_kernel.hpp.

◆ Scale() [1/2]

double Scale ( ) const
inline

Get scale factor.

Definition at line 66 of file hyperbolic_tangent_kernel.hpp.

◆ Scale() [2/2]

double& Scale ( )
inline

Modify scale factor.

Definition at line 68 of file hyperbolic_tangent_kernel.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)
inline

Serialize the kernel.

Definition at line 77 of file hyperbolic_tangent_kernel.hpp.


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