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
47 Padding(
const size_t padWLeft = 0,
48 const size_t padWRight = 0,
49 const size_t padHTop = 0,
50 const size_t padHBottom = 0,
51 const size_t inputWidth = 0,
52 const size_t inputHeight = 0);
62 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
75 const arma::Mat<eT>& gy,
84 OutputDataType
const&
Delta()
const {
return delta; }
86 OutputDataType&
Delta() {
return delta; }
99 size_t PadHTop()
const {
return padHTop; }
131 template<
typename Archive>
132 void serialize(Archive& ar,
const uint32_t );
166 arma::cube inputTemp;
169 arma::cube outputTemp;
172 OutputDataType delta;
175 OutputDataType outputParameter;
OutputDataType & Delta()
Modify the delta.
Definition: padding.hpp:86
size_t OutputWidth() const
Get the output width.
Definition: padding.hpp:119
size_t InputWidth() const
Get the input width.
Definition: padding.hpp:109
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: padding.hpp:79
size_t OutputHeight() const
Get the output height.
Definition: padding.hpp:124
OutputDataType const & Delta() const
Get the delta.
Definition: padding.hpp:84
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
size_t & PadHBottom()
Modify the bottom padding width.
Definition: padding.hpp:106
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: padding.hpp:81
size_t & InputWidth()
Modify the input width.
Definition: padding.hpp:111
size_t & PadHTop()
Modify the top padding width.
Definition: padding.hpp:101
size_t & PadWRight()
Modify the right padding width.
Definition: padding.hpp:96
size_t PadWLeft() const
Get the left padding width.
Definition: padding.hpp:89
size_t & OutputWidth()
Modify the output width.
Definition: padding.hpp:121
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: padding_impl.hpp:91
size_t PadWRight() const
Get the right padding width.
Definition: padding.hpp:94
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...
Definition: padding_impl.hpp:80
size_t InputHeight() const
Get the input height.
Definition: padding.hpp:114
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...
Definition: padding_impl.hpp:44
Padding(const size_t padWLeft=0, const size_t padWRight=0, const size_t padHTop=0, const size_t padHBottom=0, const size_t inputWidth=0, const size_t inputHeight=0)
Create the Padding object using the specified number of output units.
Definition: padding_impl.hpp:23
size_t PadHTop() const
Get the top padding width.
Definition: padding.hpp:99
size_t & OutputHeight()
Modify the output height.
Definition: padding.hpp:126
size_t PadHBottom() const
Get the bottom padding width.
Definition: padding.hpp:104
size_t & PadWLeft()
Modify the left padding width.
Definition: padding.hpp:91
size_t & InputHeight()
Modify the input height.
Definition: padding.hpp:116