SwishFunction Class Reference

The swish function, defined by. More...

Static Public Member Functions

static double Deriv (const double y)
 Computes the first derivative of the swish function. More...

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

 
static double Fn (const double x)
 Computes the swish function. More...

 
template
static void Fn (const arma::Mat< eT > &x, arma::Mat< eT > &y)
 Computes the swish function using a matrix as input. More...

 
template
static void Fn (const InputVecType &x, OutputVecType &y)
 Computes the swish function. More...

 

Detailed Description

The swish function, defined by.

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

Definition at line 30 of file swish_function.hpp.

Member Function Documentation

◆ Deriv() [1/2]

static double Deriv ( const double  y)
inlinestatic

Computes the first derivative of the swish function.

Parameters
yInput data.
Returns
f'(x)

Definition at line 77 of file swish_function.hpp.

◆ Deriv() [2/2]

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

Computes the first derivatives of the swish function.

Parameters
yInput data.
xThe resulting derivatives.

Definition at line 90 of file swish_function.hpp.

◆ Fn() [1/3]

static double Fn ( const double  x)
inlinestatic

Computes the swish function.

Parameters
xInput data.
Returns
f(x).

Definition at line 39 of file swish_function.hpp.

Referenced by SwishFunction::Fn().

◆ Fn() [2/3]

static void Fn ( const arma::Mat< eT > &  x,
arma::Mat< eT > &  y 
)
inlinestatic

Computes the swish function using a matrix as input.

Parameters
xInput data.
yThe resulting output activation.

Definition at line 51 of file swish_function.hpp.

◆ Fn() [3/3]

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

Computes the swish function.

Parameters
xInput data.
yThe resulting output activation.

Definition at line 63 of file swish_function.hpp.

References SwishFunction::Fn().


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