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

The rectifier function, defined by. More...

#include <rectifier_function.hpp>

Static Public Member Functions

static double Fn (const double x)
 Computes the rectifier function. More...
 
template<typename eT >
static void Fn (const arma::Mat< eT > &x, arma::Mat< eT > &y)
 Computes the rectifier function using a dense matrix as input. More...
 
template<typename eT >
static void Fn (const arma::Cube< eT > &x, arma::Cube< eT > &y)
 Computes the rectifier function using a 3rd-order tensor as input. More...
 
static double Deriv (const double x)
 Computes the first derivative of the rectifier function. More...
 
template<typename InputType , typename OutputType >
static void Deriv (const InputType &y, OutputType &x)
 Computes the first derivatives of the rectifier function. More...
 

Detailed Description

The rectifier function, defined by.

\begin{eqnarray*} f(x) &=& \max(0, x) \\ f'(x) &=& \left\{ \begin{array}{lr} 1 & : x > 0 \\ 0 & : x \le 0 \end{array} \right. \end{eqnarray*}

Member Function Documentation

◆ Deriv() [1/2]

static double mlpack::ann::RectifierFunction::Deriv ( const double  x)
inlinestatic

Computes the first derivative of the rectifier function.

Parameters
xInput data.
Returns
f'(x)

◆ Deriv() [2/2]

template<typename InputType , typename OutputType >
static void mlpack::ann::RectifierFunction::Deriv ( const InputType &  y,
OutputType &  x 
)
inlinestatic

Computes the first derivatives of the rectifier function.

Parameters
yInput data.
xThe resulting derivatives.

◆ Fn() [1/3]

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

Computes the rectifier function.

Parameters
xInput data.
Returns
f(x).

◆ Fn() [2/3]

template<typename eT >
static void mlpack::ann::RectifierFunction::Fn ( const arma::Mat< eT > &  x,
arma::Mat< eT > &  y 
)
inlinestatic

Computes the rectifier function using a dense matrix as input.

Parameters
xInput data.
yThe resulting output activation.

◆ Fn() [3/3]

template<typename eT >
static void mlpack::ann::RectifierFunction::Fn ( const arma::Cube< eT > &  x,
arma::Cube< eT > &  y 
)
inlinestatic

Computes the rectifier function using a 3rd-order tensor as input.

Parameters
xInput data.
yThe resulting output activation.

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