mlpack
Static Public Member Functions | List of all members
mlpack::ann::HardSigmoidFunction Class Reference

The hard sigmoid function, defined by. More...

#include <hard_sigmoid_function.hpp>

Static Public Member Functions

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

Detailed Description

The hard sigmoid function, defined by.

\begin{eqnarray*} f(x) &=& \min(1, \max(0, 0.2 * x + 0.5)) \\ f'(x) &=& \left\{ \begin{array}{lr} 0.0 & : x={0,1} \\ 0.2 \end{array} \right. \end{eqnarray*}

Member Function Documentation

◆ Deriv() [1/2]

static double mlpack::ann::HardSigmoidFunction::Deriv ( const double  y)
inlinestatic

Computes the first derivatives of hard sigmoid function.

Parameters
yInput data.
Returns
f'(x)

◆ Deriv() [2/2]

template<typename InputVecType , typename OutputVecType >
static void mlpack::ann::HardSigmoidFunction::Deriv ( const InputVecType &  y,
OutputVecType &  x 
)
inlinestatic

Computes the first derivatives of the hard sigmoid function.

Parameters
yInput data.
xThe resulting derivatives.

◆ Fn() [1/2]

static double mlpack::ann::HardSigmoidFunction::Fn ( const double  x)
inlinestatic

Computes the hard sigmoid function.

Parameters
xInput data.
Returns
f(x).

◆ Fn() [2/2]

template<typename InputVecType , typename OutputVecType >
static void mlpack::ann::HardSigmoidFunction::Fn ( const InputVecType &  x,
OutputVecType &  y 
)
inlinestatic

Computes the hard sigmoid function.

Parameters
xInput data.
yThe resulting output activations.

The documentation for this class was generated from the following file: