The PReLU activation function, defined by (where alpha is trainable) More...
Public Member Functions | |
PReLU (const double userAlpha=0.03) | |
Create the PReLU object using the specified parameters. More... | |
double const & | Alpha () const |
Get the non zero gradient. More... | |
double & | Alpha () |
Modify the non zero gradient. 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 () |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the layer. More... | |
size_t | WeightSize () const |
Get size of weights. More... | |
The PReLU activation function, defined by (where alpha is trainable)
InputDataType | Type of the input data (arma::colvec, arma::mat, 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 45 of file parametric_relu.hpp.
PReLU | ( | const double | userAlpha = 0.03 | ) |
Create the PReLU object using the specified parameters.
The non zero gradient can be adjusted by specifying tha parameter alpha in the range 0 to 1. Default (alpha = 0.03). This parameter is trainable.
userAlpha | Non zero gradient |
|
inline |
Get the non zero gradient.
Definition at line 118 of file parametric_relu.hpp.
|
inline |
Modify the non zero gradient.
Definition at line 120 of file parametric_relu.hpp.
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 108 of file parametric_relu.hpp.
|
inline |
Modify the delta.
Definition at line 110 of file parametric_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 113 of file parametric_relu.hpp.
|
inline |
Modify the gradient.
Definition at line 115 of file parametric_relu.hpp.
|
inline |
Get the output parameter.
Definition at line 103 of file parametric_relu.hpp.
|
inline |
Modify the output parameter.
Definition at line 105 of file parametric_relu.hpp.
|
inline |
Get the parameters.
Definition at line 98 of file parametric_relu.hpp.
|
inline |
Modify the parameters.
Definition at line 100 of file parametric_relu.hpp.
void Reset | ( | ) |
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the layer.
Referenced by PReLU< InputDataType, OutputDataType >::WeightSize().
|
inline |
Get size of weights.
Definition at line 123 of file parametric_relu.hpp.
References PReLU< InputDataType, OutputDataType >::serialize().