16 #ifndef MLPACK_METHODS_ANN_LAYER_SOFTSHRINK_HPP 17 #define MLPACK_METHODS_ANN_LAYER_SOFTSHRINK_HPP 47 typename InputDataType = arma::mat,
48 typename OutputDataType = arma::mat
74 template<
typename InputType,
typename OutputType>
75 void Forward(
const InputType& input, OutputType& output);
86 template<
typename DataType>
97 OutputDataType
const&
Delta()
const {
return delta; }
99 OutputDataType&
Delta() {
return delta; }
102 double const&
Lambda()
const {
return lambda; }
109 template<
typename Archive>
110 void serialize(Archive& ar,
const uint32_t );
114 OutputDataType delta;
117 OutputDataType outputParameter;
OutputDataType & Delta()
Modify the delta.
Definition: softshrink.hpp:99
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
double & Lambda()
Modify the hyperparameter lambda.
Definition: softshrink.hpp:104
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
Definition: softshrink_impl.hpp:32
Soft Shrink operator is defined as, .
Definition: softshrink.hpp:50
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: softshrink.hpp:92
SoftShrink(const double lambda=0.5)
Create Soft Shrink object using specified hyperparameter lambda.
Definition: softshrink_impl.hpp:24
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...
Definition: softshrink_impl.hpp:41
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: softshrink.hpp:94
double const & Lambda() const
Get the hyperparameter lambda.
Definition: softshrink.hpp:102
OutputDataType const & Delta() const
Get the delta.
Definition: softshrink.hpp:97
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: softshrink_impl.hpp:51