24 #ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_ELLIOT_FUNCTION_HPP
25 #define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_ELLIOT_FUNCTION_HPP
49 static double Fn(
const double x)
51 return x / (1.0 + std::abs(x));
60 template <
typename InputVecType,
typename OutputVecType>
61 static void Fn(
const InputVecType &x, OutputVecType &y)
63 y = x / (1.0 + arma::abs(x));
72 static double Deriv(
const double y)
74 return 1.0 / std::pow(1.0 + std::abs(y), 2);
83 template <
typename InputVecType,
typename OutputVecType>
84 static void Deriv(
const InputVecType &y, OutputVecType &x)
86 x = 1.0 / arma::pow(1.0 + arma::abs(y), 2);