12 #ifndef MLPACK_METHODS_ANN_LAYER_NOISYLINEAR_HPP 13 #define MLPACK_METHODS_ANN_LAYER_NOISYLINEAR_HPP 30 typename InputDataType = arma::mat,
31 typename OutputDataType = arma::mat
46 const size_t outSize);
83 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
96 const arma::Mat<eT>& gy,
106 template<
typename eT>
107 void Gradient(
const arma::Mat<eT>& input,
108 const arma::Mat<eT>& error,
109 arma::Mat<eT>& gradient);
127 OutputDataType
const&
Delta()
const {
return delta; }
129 OutputDataType&
Delta() {
return delta; }
138 OutputDataType
const&
Gradient()
const {
return gradient; }
149 arma::mat&
Bias() {
return bias; }
152 size_t WeightSize()
const {
return (outSize * inSize + outSize) * 2; }
156 template<
typename Archive>
157 void serialize(Archive& ar,
const uint32_t );
167 OutputDataType weights;
170 OutputDataType weight;
173 OutputDataType weightMu;
176 OutputDataType weightSigma;
179 OutputDataType weightEpsilon;
185 OutputDataType biasMu;
188 OutputDataType biasSigma;
191 OutputDataType biasEpsilon;
194 OutputDataType delta;
197 OutputDataType gradient;
200 InputDataType inputParameter;
203 OutputDataType outputParameter;
210 #include "noisylinear_impl.hpp" OutputDataType & Delta()
Modify the delta.
OutputDataType & OutputParameter()
Modify the output parameter.
OutputDataType const & Parameters() const
Get the parameters.
NoisyLinear & operator=(const NoisyLinear &layer)
Operator= copy constructor.
OutputDataType & Gradient()
Modify the gradient.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType const & Gradient() const
Get the gradient.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
The core includes that mlpack expects; standard C++ includes and Armadillo.
NoisyLinear()
Create the NoisyLinear object.
OutputDataType const & OutputParameter() const
Get the output parameter.
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
arma::mat & Bias()
Modify the bias weights of the layer.
size_t WeightSize() const
Get size of weights.
OutputDataType & Parameters()
Modify the parameters.
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
size_t InputSize() const
Get the input size.
size_t OutputSize() const
Get the output size.
size_t InputShape() const
Get the shape of the input.
OutputDataType const & Delta() const
Get the delta.
InputDataType const & InputParameter() const
Get the input parameter.
InputDataType & InputParameter()
Modify the input parameter.