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.
Definition: lisht_function.hpp:42
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the LiSHT function.
Definition: lisht_function.hpp:63
The core includes that mlpack expects; standard C++ includes and Armadillo.
static double Deriv(const double y)
Computes the first derivative of the LiSHT function.
Definition: lisht_function.hpp:74
static double Fn(const double x)
Computes the LiSHT function.
Definition: lisht_function.hpp:51
static void Deriv(const InputVecType &y, OutputVecType &x)
Computes the first derivatives of the LiSHT function.
Definition: lisht_function.hpp:86