16 #ifndef MLPACK_METHODS_ANN_LAYER_HARDSHRINK_HPP
17 #define MLPACK_METHODS_ANN_LAYER_HARDSHRINK_HPP
45 typename InputDataType = arma::mat,
46 typename OutputDataType = arma::mat
68 template<
typename InputType,
typename OutputType>
69 void Forward(
const InputType& input, OutputType& output);
80 template<
typename DataType>
91 OutputDataType
const&
Delta()
const {
return delta; }
93 OutputDataType&
Delta() {
return delta; }
96 double const&
Lambda()
const {
return lambda; }
103 template<
typename Archive>
104 void serialize(Archive& ar,
const unsigned int );
108 OutputDataType delta;
111 OutputDataType outputParameter;
121 #include "hardshrink_impl.hpp"
OutputDataType const & Delta() const
Get the delta.
OutputDataType & OutputParameter()
Modify the output parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double const & Lambda() const
Get the hyperparameter lambda.
HardShrink(const double lambda=0.5)
Create HardShrink object using specified hyperparameter lambda.
double & Lambda()
Modify the hyperparameter lambda.
OutputDataType & Delta()
Modify the delta.
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType const & OutputParameter() const
Get the output parameter.
Hard Shrink operator is defined as, lambda is set to 0.5 by default.
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...