12#ifndef MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_GAUSSIAN_FUNCTION_HPP
13#define MLPACK_METHODS_ANN_ACTIVATION_FUNCTIONS_GAUSSIAN_FUNCTION_HPP
38 static double Fn(
const eT x)
40 return std::exp(-1 * std::pow(x, 2));
49 template<
typename InputVecType,
typename OutputVecType>
50 static void Fn(
const InputVecType& x, OutputVecType& y)
52 y = arma::exp(-1 * arma::pow(x, 2));
61 static double Deriv(
const double y)
63 return 2 * -y * std::exp(-1 * std::pow(y, 2));
72 template<
typename InputVecType,
typename OutputVecType>
73 static void Deriv(
const InputVecType& y, OutputVecType& x)
75 x = 2 * -y % arma::exp(-1 * arma::pow(y, 2));
The gaussian function, defined by.
static double Deriv(const double y)
Computes the first derivative of the gaussian function.
static double Fn(const eT x)
Computes the gaussian function.
static void Deriv(const InputVecType &y, OutputVecType &x)
Computes the first derivatives of the gaussian function.
static void Fn(const InputVecType &x, OutputVecType &y)
Computes the gaussian function.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.