26 #ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_TANH_EXPONENTIAL_FUNCTION_HPP 27 #define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_TANH_EXPONENTIAL_FUNCTION_HPP 51 static double Fn(
const double x)
53 return x * std::tanh(std::exp(x));
62 template<
typename InputVecType,
typename OutputVecType>
63 static void Fn(
const InputVecType& x, OutputVecType& y)
65 y = x % arma::tanh(arma::exp(x));
74 static double Deriv(
const double y)
76 return std::tanh(std::exp(y)) - y * std::exp(y) *
77 (std::pow(std::tanh(std::exp(y)), 2) - 1);
86 template<
typename InputVecType,
typename OutputVecType>
87 static void Deriv(
const InputVecType& y, OutputVecType& x)
89 x = arma::tanh(arma::exp(y)) - y % arma::exp(y) %
90 (arma::pow(arma::tanh(arma::exp(y)), 2) - 1);
static void Deriv(const InputVecType &y, OutputVecType &x)
Computes the first derivatives of the tanh function.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
The TanhExp function, defined by.
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the TanhExp function.
static double Deriv(const double y)
Computes the first derivative of the TanhExp function.
static double Fn(const double x)
Computes the TanhExp function.