LogisticFunction Class Reference

The logistic function, defined by. More...

Static Public Member Functions

static double Deriv (const double x)
 Computes the first derivative of the logistic function. More...

 
template
<
typename
InputVecType
,
typename
OutputVecType
>
static void Deriv (const InputVecType &y, OutputVecType &x)
 Computes the first derivatives of the logistic function. More...

 
template
<
typename
eT
>
static double Fn (const eT x)
 Computes the logistic function. More...

 
template
<
typename
InputVecType
,
typename
OutputVecType
>
static void Fn (const InputVecType &x, OutputVecType &y)
 Computes the logistic function. More...

 
static double Inv (const double y)
 Computes the inverse of the logistic function. More...

 
template
<
typename
InputVecType
,
typename
OutputVecType
>
static void Inv (const InputVecType &y, OutputVecType &x)
 Computes the inverse of the logistic function. More...

 

Detailed Description

The logistic function, defined by.

\begin{eqnarray*} f(x) &=& \frac{1}{1 + e^{-x}} \\ f'(x) &=& f(x) * (1 - f(x)) \\ f^{-1}(y) &=& ln(\frac{y}{1-y}) \end{eqnarray*}

Definition at line 29 of file logistic_function.hpp.

Member Function Documentation

◆ Deriv() [1/2]

static double Deriv ( const double  x)
inlinestatic

Computes the first derivative of the logistic function.

Parameters
xInput activation.
Returns
f'(x)

Definition at line 70 of file logistic_function.hpp.

◆ Deriv() [2/2]

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

Computes the first derivatives of the logistic function.

Parameters
yInput activations.
xThe resulting derivatives.

Definition at line 82 of file logistic_function.hpp.

◆ Fn() [1/2]

static double Fn ( const eT  x)
inlinestatic

Computes the logistic function.

Parameters
xInput data.
Returns
f(x).

Definition at line 39 of file logistic_function.hpp.

◆ Fn() [2/2]

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

Computes the logistic function.

Parameters
xInput data.
yThe resulting output activation.

Definition at line 59 of file logistic_function.hpp.

◆ Inv() [1/2]

static double Inv ( const double  y)
inlinestatic

Computes the inverse of the logistic function.

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

Definition at line 93 of file logistic_function.hpp.

◆ Inv() [2/2]

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

Computes the inverse of the logistic function.

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

Definition at line 105 of file logistic_function.hpp.


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/logistic_function.hpp