12 #ifndef MLPACK_METHODS_ANN_LAYER_ADAPTIVE_MEAN_POOLING_IMPL_HPP 13 #define MLPACK_METHODS_ANN_LAYER_ADAPTIVE_MEAN_POOLING_IMPL_HPP 21 template<
typename InputDataType,
typename OutputDataType>
27 template <
typename InputDataType,
typename OutputDataType>
29 const size_t outputWidth,
30 const size_t outputHeight) :
36 template <
typename InputDataType,
typename OutputDataType>
38 const std::tuple<size_t, size_t>& outputShape):
39 outputWidth(
std::get<0>(outputShape)),
40 outputHeight(
std::get<1>(outputShape)),
46 template<
typename InputDataType,
typename OutputDataType>
49 const arma::Mat<eT>& input, arma::Mat<eT>& output)
53 IntializeAdaptivePadding();
57 poolingLayer.Forward(input, output);
60 template<
typename InputDataType,
typename OutputDataType>
63 const arma::Mat<eT>& input,
64 const arma::Mat<eT>& gy,
67 poolingLayer.Backward(input, gy, g);
70 template<
typename InputDataType,
typename OutputDataType>
71 template<
typename Archive>
76 ar(CEREAL_NVP(outputWidth));
77 ar(CEREAL_NVP(outputHeight));
78 ar(CEREAL_NVP(reset));
79 ar(CEREAL_NVP(poolingLayer));
void serialize(Archive &ar, const uint32_t version)
Serialize the layer.
Definition: adaptive_mean_pooling_impl.hpp:72
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
Definition: pointer_wrapper.hpp:23
Implementation of the MeanPooling.
Definition: mean_pooling.hpp:33
Implementation of the AdaptiveMeanPooling.
Definition: adaptive_mean_pooling.hpp:34
AdaptiveMeanPooling()
Create the AdaptiveMeanPooling object.
Definition: adaptive_mean_pooling_impl.hpp:22
void Backward(const arma::Mat< eT > &input, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of a neural network, using 3rd-order tensors as input, calculating the function f(x) by propagating x backwards through f.
Definition: adaptive_mean_pooling_impl.hpp:62
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: adaptive_mean_pooling_impl.hpp:48