26 #ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_ELISH_FUNCTION_HPP 27 #define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_ELISH_FUNCTION_HPP 57 static double Fn(
const double x)
60 return (std::exp(x) - 1) / (1 + std::exp(-x));
62 return x / (1 + std::exp(-x));
71 template<
typename InputVecType,
typename OutputVecType>
72 static void Fn(
const InputVecType& x, OutputVecType& y)
74 y = ((x < 0.0) % ((arma::exp(x) -1) / (1 + arma::exp(-x))))
75 + ((x >= 0.0) % (x / (1 + arma::exp(-x))));
84 static double Deriv(
const double y)
88 return std::exp(y) - 2 / (1 + std::exp(y)) +
89 2 / std::pow(1 + std::exp(y) , 2);
92 return 1 / (1 + std::exp(-y)) + y * std::exp(-y) /
93 std::pow(1 + std::exp(-y) , 2);
102 template<
typename InputVecType,
typename OutputVecType>
103 static void Deriv(
const InputVecType& y, OutputVecType& x)
105 x = ((y < 0.0) % (arma::exp(y) - 2 / (1 + arma::exp(y)) + 2 / arma::pow(
106 1 + arma::exp(y), 2))) + ((y >= 0.0) % (1 / (1 + arma::exp(-y)) + y %
107 arma::exp(-y) / arma::pow(1 + arma::exp(-y), 2)));
static double Fn(const double x)
Computes the ELiSH function.
Linear algebra utility functions, generally performed on matrices or vectors.
static void Deriv(const InputVecType &y, OutputVecType &x)
Computes the first derivatives of the ELiSH function.
The core includes that mlpack expects; standard C++ includes and Armadillo.
The ELiSH function, defined by.
static double Deriv(const double y)
Computes the first derivatives of ELiSH function.
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the ELiSH function.