The FlexibleReLU activation function, defined by. More...
Public Member Functions | |
FlexibleReLU (const double alpha=0) | |
Create the FlexibleReLU object using the specified parameters. More... | |
double const & | Alpha () const |
Get the parameter controlling the range of the relu function. More... | |
double & | Alpha () |
Modify the parameter controlling the range of the relu function. More... | |
template < typename DataType > | |
void | Backward (const DataType &input, const DataType &gy, DataType &g) |
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards through f. More... | |
OutputDataType const & | Delta () const |
Get the delta. More... | |
OutputDataType & | Delta () |
Modify the delta. More... | |
template < typename InputType , typename OutputType > | |
void | Forward (const InputType &input, OutputType &output) |
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f. More... | |
template < typename eT > | |
void | Gradient (const arma::Mat< eT > &input, const arma::Mat< eT > &error, arma::Mat< eT > &gradient) |
Calculate the gradient using the output delta and the input activation. More... | |
OutputDataType const & | Gradient () const |
Get the gradient. More... | |
OutputDataType & | Gradient () |
Modify the gradient. More... | |
OutputDataType const & | OutputParameter () const |
Get the output parameter. More... | |
OutputDataType & | OutputParameter () |
Modify the output parameter. More... | |
OutputDataType const & | Parameters () const |
Get the parameters. More... | |
OutputDataType & | Parameters () |
Modify the parameters. More... | |
void | Reset () |
Reset the layer parameter. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the layer. More... | |
The FlexibleReLU activation function, defined by.
For more information, read the following paper:
InputDataType | Type of the input data (arma::colvec, arma::mar, arma::sp_mat or arma::cube) |
OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube) |
Definition at line 59 of file flexible_relu.hpp.
FlexibleReLU | ( | const double | alpha = 0 | ) |
Create the FlexibleReLU object using the specified parameters.
The non zero parameter can be adjusted by specifying the parameter alpha which controls the range of the relu function. (Default alpha = 0) This parameter is trainable.
alpha | Parameter for adjusting the range of the relu function. |
|
inline |
Get the parameter controlling the range of the relu function.
Definition at line 134 of file flexible_relu.hpp.
|
inline |
Modify the parameter controlling the range of the relu function.
Definition at line 136 of file flexible_relu.hpp.
References FlexibleReLU< InputDataType, OutputDataType >::serialize().
void Backward | ( | const DataType & | input, |
const DataType & | gy, | ||
DataType & | g | ||
) |
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards through f.
Using the results from the feed forward pass.
input | The propagated input activation. |
gy | The backpropagated error. |
g | The calculated gradient. |
|
inline |
Get the delta.
Definition at line 124 of file flexible_relu.hpp.
|
inline |
Modify the delta.
Definition at line 126 of file flexible_relu.hpp.
void Forward | ( | const InputType & | input, |
OutputType & | output | ||
) |
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f.
input | Input data used for evaluating the specified function. |
output | Resulting output activation. |
void Gradient | ( | const arma::Mat< eT > & | input, |
const arma::Mat< eT > & | error, | ||
arma::Mat< eT > & | gradient | ||
) |
Calculate the gradient using the output delta and the input activation.
input | The input parameter used for calculating the gradient. |
error | The calculated error. |
gradient | The calculated gradient. |
|
inline |
Get the gradient.
Definition at line 129 of file flexible_relu.hpp.
|
inline |
Modify the gradient.
Definition at line 131 of file flexible_relu.hpp.
|
inline |
Get the output parameter.
Definition at line 119 of file flexible_relu.hpp.
|
inline |
Modify the output parameter.
Definition at line 121 of file flexible_relu.hpp.
|
inline |
Get the parameters.
Definition at line 114 of file flexible_relu.hpp.
|
inline |
Modify the parameters.
Definition at line 116 of file flexible_relu.hpp.
void Reset | ( | ) |
Reset the layer parameter.
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the layer.
Referenced by FlexibleReLU< InputDataType, OutputDataType >::Alpha().