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;
130 #include "hard_tanh_impl.hpp" double & MaxValue()
Modify the maximum value.
Linear algebra utility functions, generally performed on matrices or vectors.
double & MinValue()
Modify the minimum value.
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 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...
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 & Delta()
Modify the delta.
HardTanH(const double maxValue=1, const double minValue=-1)
Create the HardTanH object using the specified parameters.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
OutputDataType const & OutputParameter() const
Get the output parameter.