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>
114 OutputDataType delta;
117 OutputDataType outputParameter;
127#include "softshrink_impl.hpp"
Soft Shrink operator is defined as,.
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 const & Delta() const
Get the delta.
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...
double & Lambda()
Modify the hyperparameter lambda.
OutputDataType const & OutputParameter() const
Get the output parameter.
double const & Lambda() const
Get the hyperparameter lambda.
OutputDataType & OutputParameter()
Modify the output parameter.
SoftShrink(const double lambda=0.5)
Create Soft Shrink object using specified hyperparameter lambda.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType & Delta()
Modify the delta.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.