12 #ifndef MLPACK_METHODS_ANN_LAYER_HARD_TANH_HPP 13 #define MLPACK_METHODS_ANN_LAYER_HARD_TANH_HPP 46 typename InputDataType = arma::mat,
47 typename OutputDataType = arma::mat
60 HardTanH(
const double maxValue = 1,
const double minValue = -1);
69 template<
typename InputType,
typename OutputType>
70 void Forward(
const InputType& input, OutputType& output);
81 template<
typename DataType>
92 OutputDataType
const&
Delta()
const {
return delta; }
94 OutputDataType&
Delta() {
return delta; }
97 double const&
MaxValue()
const {
return maxValue; }
102 double const&
MinValue()
const {
return minValue; }
109 template<
typename Archive>
110 void serialize(Archive& ar,
const uint32_t );
114 OutputDataType delta;
117 OutputDataType outputParameter;
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: hard_tanh_impl.hpp:33
OutputDataType const & Delta() const
Get the delta.
Definition: hard_tanh.hpp:92
double const & MaxValue() const
Get the maximum value.
Definition: hard_tanh.hpp:97
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: hard_tanh.hpp:87
The core includes that mlpack expects; standard C++ includes and Armadillo.
double & MaxValue()
Modify the maximum value.
Definition: hard_tanh.hpp:99
double & MinValue()
Modify the minimum value.
Definition: hard_tanh.hpp:104
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: hard_tanh_impl.hpp:61
The Hard Tanh activation function, defined by.
Definition: hard_tanh.hpp:49
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: hard_tanh_impl.hpp:46
OutputDataType & Delta()
Modify the delta.
Definition: hard_tanh.hpp:94
HardTanH(const double maxValue=1, const double minValue=-1)
Create the HardTanH object using the specified parameters.
Definition: hard_tanh_impl.hpp:22
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: hard_tanh.hpp:89
double const & MinValue() const
Get the minimum value.
Definition: hard_tanh.hpp:102