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)
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)
constexpr auto size(Container const &container) noexcept -> decltype(container.size())
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes, Armadillo, cereal, and a few basic mlpa...
constexpr T const & max(T const &lhs, T const &rhs)
static void Deriv(const InputVecType &y, OutputVecType &x)
Computes the first derivatives of the hard sigmoid function.
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the hard sigmoid function.
constexpr T const & min(T const &lhs, T const &rhs)
static double Fn(const double x)
Computes the hard sigmoid function.
The hard sigmoid function, defined by.
static double Deriv(const double y)
Computes the first derivatives of hard sigmoid function.