14 #ifndef MLPACK_METHODS_ANN_LAYER_LEAKYRELU_HPP 15 #define MLPACK_METHODS_ANN_LAYER_LEAKYRELU_HPP 41 typename InputDataType = arma::mat,
42 typename OutputDataType = arma::mat
63 template<
typename InputType,
typename OutputType>
64 void Forward(
const InputType& input, OutputType& output);
75 template<
typename DataType>
76 void Backward(
const DataType& input,
const DataType& gy, DataType& g);
84 OutputDataType
const&
Delta()
const {
return delta; }
86 OutputDataType&
Delta() {
return delta; }
89 double const&
Alpha()
const {
return alpha; }
91 double&
Alpha() {
return alpha; }
99 template<
typename Archive>
100 void serialize(Archive& ar,
const uint32_t );
104 OutputDataType delta;
107 OutputDataType outputParameter;
OutputDataType const & Delta() const
Get the delta.
Definition: leaky_relu.hpp:84
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: leaky_relu.hpp:81
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
The LeakyReLU activation function, defined by.
Definition: leaky_relu.hpp:44
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
Definition: leaky_relu_impl.hpp:32
OutputDataType & Delta()
Modify the delta.
Definition: leaky_relu.hpp:86
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: leaky_relu_impl.hpp:53
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: leaky_relu.hpp:79
LeakyReLU(const double alpha=0.03)
Create the LeakyReLU object using the specified parameters.
Definition: leaky_relu_impl.hpp:24
size_t WeightSize() const
Get size of weights.
Definition: leaky_relu.hpp:94
double & Alpha()
Modify the non zero gradient.
Definition: leaky_relu.hpp:91
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 backw...
Definition: leaky_relu_impl.hpp:40
double const & Alpha() const
Get the non zero gradient.
Definition: leaky_relu.hpp:89