MLPACK  1.0.8
Public Member Functions | Private Attributes | List of all members
mlpack::kernel::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 VecType >
double Evaluate (const VecType &a, const VecType &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...
 

Private Attributes

double offset
 
double scale
 

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

Constructor & Destructor Documentation

mlpack::kernel::HyperbolicTangentKernel::HyperbolicTangentKernel ( )
inline

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

Definition at line 44 of file hyperbolic_tangent_kernel.hpp.

mlpack::kernel::HyperbolicTangentKernel::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 54 of file hyperbolic_tangent_kernel.hpp.

Member Function Documentation

template<typename VecType >
double mlpack::kernel::HyperbolicTangentKernel::Evaluate ( const VecType &  a,
const VecType &  b 
)
inline

Evaluate the hyperbolic tangent kernel.

This evaluation uses Armadillo's dot() function.

Template Parameters
VecTypeType of vector (should be arma::vec or arma::spvec).
Parameters
aFirst vector.
bSecond vector.
Returns
K(a, b).

Definition at line 68 of file hyperbolic_tangent_kernel.hpp.

References offset, and scale.

double mlpack::kernel::HyperbolicTangentKernel::Offset ( ) const
inline

Get offset for the kernel.

Definition at line 79 of file hyperbolic_tangent_kernel.hpp.

References offset.

double& mlpack::kernel::HyperbolicTangentKernel::Offset ( )
inline

Modify offset for the kernel.

Definition at line 81 of file hyperbolic_tangent_kernel.hpp.

References offset.

double mlpack::kernel::HyperbolicTangentKernel::Scale ( ) const
inline

Get scale factor.

Definition at line 74 of file hyperbolic_tangent_kernel.hpp.

References scale.

double& mlpack::kernel::HyperbolicTangentKernel::Scale ( )
inline

Modify scale factor.

Definition at line 76 of file hyperbolic_tangent_kernel.hpp.

References scale.

Member Data Documentation

double mlpack::kernel::HyperbolicTangentKernel::offset
private

Definition at line 85 of file hyperbolic_tangent_kernel.hpp.

Referenced by Evaluate(), and Offset().

double mlpack::kernel::HyperbolicTangentKernel::scale
private

Definition at line 84 of file hyperbolic_tangent_kernel.hpp.

Referenced by Evaluate(), and Scale().


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