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>
82 void Backward(
const DataType&& input,
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 unsigned int );
114 OutputDataType delta;
117 OutputDataType outputParameter;
130 #include "hard_tanh_impl.hpp" void Backward(const DataType &&input, DataType &&gy, DataType &&g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
double & MaxValue()
Modify the maximum value.
double & MinValue()
Modify the minimum value.
void Forward(const InputType &&input, OutputType &&output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
double const & MaxValue() const
Get the maximum value.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double const & MinValue() const
Get the minimum value.
The Hard Tanh activation function, defined by.
OutputDataType & OutputParameter()
Modify the output parameter.
OutputDataType const & Delta() const
Get the delta.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType & Delta()
Modify the delta.
HardTanH(const double maxValue=1, const double minValue=-1)
Create the HardTanH object using the specified parameters.
OutputDataType const & OutputParameter() const
Get the output parameter.