16 #ifndef MLPACK_METHODS_ANN_LAYER_FLEXIBLERELU_HPP 17 #define MLPACK_METHODS_ANN_LAYER_FLEXIBLERELU_HPP 56 typename InputDataType = arma::mat,
57 typename OutputDataType = arma::mat
86 template<
typename InputType,
typename OutputType>
87 void Forward(
const InputType& input, OutputType& output);
98 template<
typename DataType>
99 void Backward(
const DataType& input,
const DataType& gy, DataType& g);
108 template<
typename eT>
109 void Gradient(
const arma::Mat<eT>& input,
110 const arma::Mat<eT>& error,
111 arma::Mat<eT>& gradient);
124 OutputDataType
const&
Delta()
const {
return delta; }
126 OutputDataType&
Delta() {
return delta;}
129 OutputDataType
const&
Gradient()
const {
return gradient; }
134 double const&
Alpha()
const {
return alpha; }
141 template<
typename Archive>
142 void serialize(Archive& ar,
const uint32_t );
146 OutputDataType delta;
149 OutputDataType outputParameter;
152 OutputDataType alpha;
155 OutputDataType gradient;
OutputDataType const & Delta() const
Get the delta.
Definition: flexible_relu.hpp:124
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The FlexibleReLU activation function, defined by.
Definition: flexible_relu.hpp:59
OutputDataType & Delta()
Modify the delta.
Definition: flexible_relu.hpp:126
void Reset()
Reset the layer parameter.
Definition: flexible_relu_impl.hpp:35
The core includes that mlpack expects; standard C++ includes and Armadillo.
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: flexible_relu_impl.hpp:43
FlexibleReLU(const double alpha=0)
Create the FlexibleReLU object using the specified parameters.
Definition: flexible_relu_impl.hpp:27
OutputDataType const & Parameters() const
Get the parameters.
Definition: flexible_relu.hpp:114
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: flexible_relu.hpp:119
double & Alpha()
Modify the parameter controlling the range of the relu function.
Definition: flexible_relu.hpp:136
OutputDataType const & Gradient() const
Get the gradient.
Definition: flexible_relu.hpp:129
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: flexible_relu_impl.hpp:51
OutputDataType & Parameters()
Modify the parameters.
Definition: flexible_relu.hpp:116
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: flexible_relu.hpp:121
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: flexible_relu_impl.hpp:76
double const & Alpha() const
Get the parameter controlling the range of the relu function.
Definition: flexible_relu.hpp:134
OutputDataType & Gradient()
Modify the gradient.
Definition: flexible_relu.hpp:131