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;
117 #include "leaky_relu_impl.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 backw...
LeakyReLU(const double alpha=0.03)
Create the LeakyReLU object using the specified parameters.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
The LeakyReLU activation function, defined by.
OutputDataType const & Delta() const
Get the delta.
double const & Alpha() const
Get the non zero gradient.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
size_t WeightSize() const
Get size of weights.
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
OutputDataType const & OutputParameter() const
Get the output parameter.
double & Alpha()
Modify the non zero gradient.
OutputDataType & OutputParameter()
Modify the output parameter.
OutputDataType & Delta()
Modify the delta.