12 #ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_SPLINE_FUNCTION_HPP 13 #define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_SPLINE_FUNCTION_HPP 37 static double Fn(
const double x)
39 return std::pow(x, 2) * std::log(1 + x);
48 template<
typename InputVecType,
typename OutputVecType>
49 static void Fn(
const InputVecType& x, OutputVecType& y)
51 y = arma::pow(x, 2) % arma::log(1 + x);
60 static double Deriv(
const double y)
62 return 2 * y * std::log(1 + y) + std::pow(y, 2) / (1 + y);
71 template<
typename InputVecType,
typename OutputVecType>
72 static void Deriv(
const InputVecType& x, OutputVecType& y)
74 y = 2 * x % arma::log(1 + x) + arma::pow(x, 2) / (1 + x);
static void Deriv(const InputVecType &x, OutputVecType &y)
Computes the first derivatives of the Spline function.
Linear algebra utility functions, generally performed on matrices or vectors.
static double Deriv(const double y)
Computes the first derivative of the Spline function.
The core includes that mlpack expects; standard C++ includes and Armadillo.
The Spline function, defined by.
static double Fn(const double x)
Computes the Spline function.
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the Spline function.