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