12#ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_TANH_FUNCTION_HPP
13#define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_TANH_FUNCTION_HPP
38 static double Fn(
const double x)
49 template<
typename InputVecType,
typename OutputVecType>
50 static void Fn(
const InputVecType& x, OutputVecType& y)
61 static double Deriv(
const double y)
63 return 1 - std::pow(y, 2);
72 template<
typename InputVecType,
typename OutputVecType>
73 static void Deriv(
const InputVecType& y, OutputVecType& x)
75 x = 1 - arma::pow(y, 2);
84 static double Inv(
const double y)
95 template<
typename InputVecType,
typename OutputVecType>
96 static void Inv(
const InputVecType& y, OutputVecType& x)
The tanh function, defined by.
static double Fn(const double x)
Computes the tanh function.
static double Deriv(const double y)
Computes the first derivative of the tanh function.
static double Inv(const double y)
Computes the inverse of the tanh function.
static void Deriv(const InputVecType &y, OutputVecType &x)
Computes the first derivatives of the tanh function.
static void Inv(const InputVecType &y, OutputVecType &x)
Computes the inverse of the tanh function.
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the tanh function.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.