HardSwishFunction Class Reference

The Hard Swish function, defined by. More...

Static Public Member Functions

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

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

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

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

 

Detailed Description

The Hard Swish function, defined by.

\begin{eqnarray*} f(x) &=& \begin{cases} 0 & x \leq -3\\ x & x \geq +3\\ \frac{x * (x + 3)}{6} & otherwise\\ \end{cases} \\ f'(x) &=& \begin{cases} 0 & x \leq -3\\ 1 & x \geq +3\\ \frac{2x + 3}{6} & otherwise\\ \end{cases} \end{eqnarray*}

Definition at line 47 of file hard_swish_function.hpp.

Member Function Documentation

◆ Deriv() [1/2]

static double Deriv ( const double  y)
inlinestatic

Computes the first derivative of the Hard Swish function.

Parameters
yInput data.
Returns
f'(x).

Definition at line 87 of file hard_swish_function.hpp.

Referenced by HardSwishFunction::Deriv().

◆ Deriv() [2/2]

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

Computes the first derivatives of the Hard Swish function.

Parameters
yInput data.
xThe resulting derivatives.

Definition at line 104 of file hard_swish_function.hpp.

References HardSwishFunction::Deriv().

◆ Fn() [1/2]

static double Fn ( const double  x)
inlinestatic

Computes the Hard Swish function.

Parameters
xInput data.
Returns
f(x).

Definition at line 56 of file hard_swish_function.hpp.

Referenced by HardSwishFunction::Fn().

◆ Fn() [2/2]

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

Computes the Hard Swish function.

Parameters
xInput data.
yThe resulting output activation.

Definition at line 73 of file hard_swish_function.hpp.

References HardSwishFunction::Fn().


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