SoftsignFunction Class Reference

The softsign function, defined by. More...

Static Public Member Functions

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 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 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...

 

Detailed Description

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*}

Definition at line 47 of file softsign_function.hpp.

Member Function Documentation

◆ Deriv() [1/2]

static double Deriv ( const double  y)
inlinestatic

Computes the first derivative of the softsign function.

Parameters
yInput activation.
Returns
f'(x)

Definition at line 84 of file softsign_function.hpp.

◆ Deriv() [2/2]

static void Deriv ( const InputVecType &  y,
OutputVecType &  x 
)
inlinestatic

Computes the first derivatives of the softsign function.

Parameters
yInput activations.
xThe resulting derivatives.

Definition at line 96 of file softsign_function.hpp.

◆ Fn() [1/2]

static double Fn ( const double  x)
inlinestatic

Computes the softsign function.

Parameters
xInput data.
Returns
f(x).

Definition at line 56 of file softsign_function.hpp.

Referenced by SoftsignFunction::Fn().

◆ Fn() [2/2]

static void Fn ( const InputVecType &  x,
OutputVecType &  y 
)
inlinestatic

Computes the softsign function.

Parameters
xInput data.
yThe resulting output activation.

Definition at line 70 of file softsign_function.hpp.

References SoftsignFunction::Fn().

◆ Inv() [1/2]

static double Inv ( const double  y)
inlinestatic

Computes the inverse of the softsign function.

Parameters
yInput data.
Returns
f^{-1}(y)

Definition at line 107 of file softsign_function.hpp.

Referenced by SoftsignFunction::Inv().

◆ Inv() [2/2]

static void Inv ( const InputVecType &  y,
OutputVecType &  x 
)
inlinestatic

Computes the inverse of the softsign function.

Parameters
yInput data.
xThe resulting inverse of the input data.

Definition at line 122 of file softsign_function.hpp.

References SoftsignFunction::Inv().


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/ann/activation_functions/softsign_function.hpp