mlpack
multi_quadratic_function.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_MULTIQUAD_FUNCTION_HPP
13 #define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_MULTIQUAD_FUNCTION_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace ann {
19 
29 {
30  public:
37  static double Fn(const double x)
38  {
39  return std::pow(1 + x * x, 0.5);
40  }
41 
48  template<typename InputVecType, typename OutputVecType>
49  static void Fn(const InputVecType& x, OutputVecType& y)
50  {
51  y = arma::pow((1 + arma::pow(x, 2)), 0.5);
52  }
53 
60  static double Deriv(const double y)
61  {
62  return y / std::pow(1 + y * y, 0.5);
63  }
64 
71  template<typename InputVecType, typename OutputVecType>
72  static void Deriv(const InputVecType& x, OutputVecType& y)
73  {
74  y = x / arma::pow((1 + arma::pow(x, 2)), 0.5);
75  }
76 }; // class MultiquadFunction
77 
78 } // namespace ann
79 } // namespace mlpack
80 
81 #endif
static double Deriv(const double y)
Computes the first derivative of the Multi Quadratic function.
Definition: multi_quadratic_function.hpp:60
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static double Fn(const double x)
Computes the Multi Quadratic function.
Definition: multi_quadratic_function.hpp:37
The core includes that mlpack expects; standard C++ includes and Armadillo.
static void Deriv(const InputVecType &x, OutputVecType &y)
Computes the first derivatives of the Multi Quadratic function.
Definition: multi_quadratic_function.hpp:72
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the Multi Quadratic function.
Definition: multi_quadratic_function.hpp:49
The Multi Quadratic function, defined by.
Definition: multi_quadratic_function.hpp:28