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