A concatenated ReLU has two outputs, one ReLU and one negative ReLU, concatenated together. More...
Public Member Functions | |
CReLU () | |
Create the CReLU object. 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... | |
OutputDataType const & | OutputParameter () const |
Get the output parameter. More... | |
OutputDataType & | OutputParameter () |
Modify the output parameter. More... | |
template < typename Archive > | |
void | serialize (Archive &, const uint32_t) |
Serialize the layer. More... | |
size_t | WeightSize () const |
Get size of weights. More... | |
A concatenated ReLU has two outputs, one ReLU and one negative ReLU, concatenated together.
In other words, for positive x it produces [x, 0], and for negative x it produces [0, x]. Because it has two outputs, CReLU doubles the output dimension.
Note: The CReLU doubles the output size.
For more information, see the following.
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 50 of file c_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 87 of file c_relu.hpp.
|
inline |
Modify the delta.
Definition at line 89 of file c_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.
Works only for 2D Tensors.
input | Input data used for evaluating the specified function. |
output | Resulting output activation. |
|
inline |
Get the output parameter.
Definition at line 82 of file c_relu.hpp.
|
inline |
Modify the output parameter.
Definition at line 84 of file c_relu.hpp.
void serialize | ( | Archive & | , |
const uint32_t | |||
) |
Serialize the layer.
Referenced by CReLU< InputDataType, OutputDataType >::WeightSize().
|
inline |
Get size of weights.
Definition at line 92 of file c_relu.hpp.
References CReLU< InputDataType, OutputDataType >::serialize().