12 #ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_HARD_SIGMOID_FUNCTION_HPP
13 #define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_HARD_SIGMOID_FUNCTION_HPP
43 static double Fn(
const double x)
45 return std::min(1.0, std::max(0.0, 0.2 * x + 0.5));
54 template<
typename InputVecType,
typename OutputVecType>
55 static void Fn(
const InputVecType& x, OutputVecType& y)
59 for (
size_t i = 0; i < x.n_elem; i++)
69 static double Deriv(
const double y)
71 if (y == 0.0 || y == 1.0)
84 template<
typename InputVecType,
typename OutputVecType>
85 static void Deriv(
const InputVecType& y, OutputVecType& x)
89 for (
size_t i = 0; i < y.n_elem; i++)