15 #ifndef MLPACK_METHODS_ANN_LAYER_HARDSHRINK_HPP 16 #define MLPACK_METHODS_ANN_LAYER_HARDSHRINK_HPP 42 typename InputDataType = arma::mat,
43 typename OutputDataType = arma::mat
65 template<
typename InputType,
typename OutputType>
66 void Forward(
const InputType& input, OutputType& output);
77 template<
typename DataType>
88 OutputDataType
const&
Delta()
const {
return delta; }
90 OutputDataType&
Delta() {
return delta; }
93 double const&
Lambda()
const {
return lambda; }
100 template<
typename Archive>
101 void serialize(Archive& ar,
const uint32_t );
105 OutputDataType delta;
108 OutputDataType outputParameter;
118 #include "hardshrink_impl.hpp" void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType & OutputParameter()
Modify the output parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType const & OutputParameter() const
Get the output parameter.
HardShrink(const double lambda=0.5)
Create HardShrink object using specified hyperparameter lambda.
double & Lambda()
Modify the hyperparameter lambda.
OutputDataType const & Delta() const
Get the delta.
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...
double const & Lambda() const
Get the hyperparameter lambda.
Hard Shrink operator is defined as,.
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...