The swish function, defined by.
More...
#include <swish_function.hpp>
|
| static double | Fn (const double x) |
| | Computes the swish function. More...
|
| |
| template<typename eT > |
| static void | Fn (const arma::Mat< eT > &x, arma::Mat< eT > &y) |
| | Computes the swish function using a matrix as input. More...
|
| |
| template<typename InputVecType , typename OutputVecType > |
| static void | Fn (const InputVecType &x, OutputVecType &y) |
| | Computes the swish function. More...
|
| |
| static double | Deriv (const double y) |
| | Computes the first derivative of the swish function. More...
|
| |
| template<typename InputVecType , typename OutputVecType > |
| static void | Deriv (const InputVecType &y, OutputVecType &x) |
| | Computes the first derivatives of the swish function. More...
|
| |
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*}
◆ Deriv() [1/2]
| static double mlpack::ann::SwishFunction::Deriv |
( |
const double |
y | ) |
|
|
inlinestatic |
Computes the first derivative of the swish function.
- Parameters
-
- Returns
- f'(x)
◆ Deriv() [2/2]
template<typename InputVecType , typename OutputVecType >
| static void mlpack::ann::SwishFunction::Deriv |
( |
const InputVecType & |
y, |
|
|
OutputVecType & |
x |
|
) |
| |
|
inlinestatic |
Computes the first derivatives of the swish function.
- Parameters
-
| y | Input data. |
| x | The resulting derivatives. |
◆ Fn() [1/3]
| static double mlpack::ann::SwishFunction::Fn |
( |
const double |
x | ) |
|
|
inlinestatic |
Computes the swish function.
- Parameters
-
- Returns
- f(x).
◆ Fn() [2/3]
template<typename eT >
| static void mlpack::ann::SwishFunction::Fn |
( |
const arma::Mat< eT > & |
x, |
|
|
arma::Mat< eT > & |
y |
|
) |
| |
|
inlinestatic |
Computes the swish function using a matrix as input.
- Parameters
-
| x | Input data. |
| y | The resulting output activation. |
◆ Fn() [3/3]
template<typename InputVecType , typename OutputVecType >
| static void mlpack::ann::SwishFunction::Fn |
( |
const InputVecType & |
x, |
|
|
OutputVecType & |
y |
|
) |
| |
|
inlinestatic |
Computes the swish function.
- Parameters
-
| x | Input data. |
| y | The resulting output activation. |
The documentation for this class was generated from the following file: