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
69 template<
typename InputType,
typename OutputType>
70 void Forward(
const InputType&& input, OutputType&& output);
81 template<
typename DataType>
82 void Backward(
const DataType&& input,
114 template<
typename Archive>
115 void Serialize(Archive& ar,
const unsigned int );
138 #include "hard_tanh_impl.hpp" double maxValue
Maximum value for the HardTanH function.
void Serialize(Archive &ar, const unsigned int)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double const & MaxValue() const
Get the maximum value.
double & MaxValue()
Modify the maximum value.
double & MinValue()
Modify the minimum value.
The Hard Tanh activation function, defined by.
OutputDataType & Delta()
Modify the delta.
double const & MinValue() const
Get the minimum value.
HardTanH(const double maxValue=1, const double minValue=-1)
Create the HardTanH object using the specified parameters.
double minValue
Minimum value for the HardTanH function.
OutputDataType const & Delta() const
Get the delta.
InputDataType & InputParameter()
Modify the input parameter.
OutputDataType delta
Locally-stored delta object.
InputDataType const & InputParameter() const
Get the input parameter.
OutputDataType & OutputParameter()
Modify the output parameter.
InputDataType inputParameter
Locally-stored input parameter object.
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...
OutputDataType const & OutputParameter() const
Get the output parameter.
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 outputParameter
Locally-stored output parameter object.