The softsign function, defined by.
More...
#include <softsign_function.hpp>
|
static double | Fn (const double x) |
| Computes the softsign function. More...
|
|
template<typename InputVecType , typename OutputVecType > |
static void | Fn (const InputVecType &x, OutputVecType &y) |
| Computes the softsign function. More...
|
|
static double | Deriv (const double y) |
| Computes the first derivative of the softsign function. More...
|
|
template<typename InputVecType , typename OutputVecType > |
static void | Deriv (const InputVecType &y, OutputVecType &x) |
| Computes the first derivatives of the softsign function. More...
|
|
static double | Inv (const double y) |
| Computes the inverse of the softsign function. More...
|
|
template<typename InputVecType , typename OutputVecType > |
static void | Inv (const InputVecType &y, OutputVecType &x) |
| Computes the inverse of the softsign function. More...
|
|
The softsign function, defined by.
\begin{eqnarray*} f(x) &=& \frac{x}{1 + |x|} \\ f'(x) &=& (1 - |f(x)|)^2 \\ f(x) &=& \left\{ \begin{array}{lr} -\frac{x}{1 - x} & : x \le 0 \\ \frac{x}{1 + x} & : x > 0 \end{array} \right. \end{eqnarray*}
◆ Deriv() [1/2]
static double mlpack::ann::SoftsignFunction::Deriv |
( |
const double |
y | ) |
|
|
inlinestatic |
Computes the first derivative of the softsign function.
- Parameters
-
- Returns
- f'(x)
◆ Deriv() [2/2]
template<typename InputVecType , typename OutputVecType >
static void mlpack::ann::SoftsignFunction::Deriv |
( |
const InputVecType & |
y, |
|
|
OutputVecType & |
x |
|
) |
| |
|
inlinestatic |
Computes the first derivatives of the softsign function.
- Parameters
-
y | Input activations. |
x | The resulting derivatives. |
◆ Fn() [1/2]
static double mlpack::ann::SoftsignFunction::Fn |
( |
const double |
x | ) |
|
|
inlinestatic |
Computes the softsign function.
- Parameters
-
- Returns
- f(x).
◆ Fn() [2/2]
template<typename InputVecType , typename OutputVecType >
static void mlpack::ann::SoftsignFunction::Fn |
( |
const InputVecType & |
x, |
|
|
OutputVecType & |
y |
|
) |
| |
|
inlinestatic |
Computes the softsign function.
- Parameters
-
x | Input data. |
y | The resulting output activation. |
◆ Inv() [1/2]
static double mlpack::ann::SoftsignFunction::Inv |
( |
const double |
y | ) |
|
|
inlinestatic |
Computes the inverse of the softsign function.
- Parameters
-
- Returns
- f^{-1}(y)
◆ Inv() [2/2]
template<typename InputVecType , typename OutputVecType >
static void mlpack::ann::SoftsignFunction::Inv |
( |
const InputVecType & |
y, |
|
|
OutputVecType & |
x |
|
) |
| |
|
inlinestatic |
Computes the inverse of the softsign function.
- Parameters
-
y | Input data. |
x | The resulting inverse of the input data. |
The documentation for this class was generated from the following file: