12 #ifndef MLPACK_METHODS_ANN_LAYER_PADDING_HPP 13 #define MLPACK_METHODS_ANN_LAYER_PADDING_HPP 31 typename InputDataType = arma::mat,
32 typename OutputDataType = arma::mat
45 Padding(
const size_t padWLeft = 0,
46 const size_t padWRight = 0,
47 const size_t padHTop = 0,
48 const size_t padHBottom = 0);
58 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
70 void Backward(
const arma::Mat<eT>&& ,
71 const arma::Mat<eT>&& gy,
80 OutputDataType
const&
Delta()
const {
return delta; }
82 OutputDataType&
Delta() {
return delta; }
95 size_t PadHTop()
const {
return padHTop; }
107 template<
typename Archive>
108 void serialize(Archive& ar,
const unsigned int );
127 OutputDataType delta;
130 OutputDataType outputParameter;
137 #include "padding_impl.hpp"
Padding(const size_t padWLeft=0, const size_t padWRight=0, const size_t padHTop=0, const size_t padHBottom=0)
Create the Padding object using the specified number of output units.
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 PadHBottom() const
Get the bottom padding width.
size_t PadWRight() const
Get the right padding width.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t & PadWLeft()
Modify the left padding width.
size_t & PadHBottom()
Modify the bottom padding width.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType const & Delta() const
Get the delta.
OutputDataType & OutputParameter()
Modify the output parameter.
size_t PadHTop() const
Get the top padding width.
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...
size_t PadWLeft() const
Get the left padding width.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
size_t & PadHTop()
Modify the top padding width.
OutputDataType & Delta()
Modify the delta.
size_t & PadWRight()
Modify the right padding width.