bilinear_interpolation.hpp
Go to the documentation of this file.
1 
10 #ifndef MLPACK_METHODS_ANN_LAYER_BILINEAR_INTERPOLATION_HPP
11 #define MLPACK_METHODS_ANN_LAYER_BILINEAR_INTERPOLATION_HPP
12 
13 #include <mlpack/prereqs.hpp>
14 
15 namespace mlpack {
16 namespace ann {
17 
34 template <
35  typename InputDataType = arma::mat,
36  typename OutputDataType = arma::mat
37 >
39 {
40  public:
43 
53  BilinearInterpolation(const size_t inRowSize,
54  const size_t inColSize,
55  const size_t outRowSize,
56  const size_t outColSize,
57  const size_t depth);
58 
66  template<typename eT>
67  void Forward(const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
68 
80  template<typename eT>
81  void Backward(const arma::Mat<eT>&& /*input*/,
82  arma::Mat<eT>&& gradient,
83  arma::Mat<eT>&& output);
84 
86  InputDataType const& InputParameter() const { return inputParameter; }
88  InputDataType& InputParameter() { return inputParameter; }
89 
91  OutputDataType const& OutputParameter() const { return outputParameter; }
93  OutputDataType& OutputParameter() { return outputParameter; }
94 
96  OutputDataType const& Delta() const { return delta; }
98  OutputDataType& Delta() { return delta; }
99 
103  template<typename Archive>
104  void serialize(Archive& ar, const unsigned int /* version */);
105 
106  private:
108  size_t inRowSize;
110  size_t inColSize;
112  size_t outRowSize;
114  size_t outColSize;
116  size_t depth;
118  OutputDataType delta;
120  InputDataType inputParameter;
122  OutputDataType outputParameter;
123 }; // class BilinearInterpolation
124 
125 } // namespace ann
126 } // namespace mlpack
127 
128 // Include implementation.
129 #include "bilinear_interpolation_impl.hpp"
130 
131 #endif
OutputDataType const & OutputParameter() const
Get the output parameter.
.hpp
Definition: add_to_po.hpp:21
InputDataType const & InputParameter() const
Get the input parameter.
OutputDataType & Delta()
Modify the delta.
void Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
Forward pass through the layer.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType & OutputParameter()
Modify the output parameter.
InputDataType & InputParameter()
Modify the input parameter.
OutputDataType const & Delta() const
Get the delta.
BilinearInterpolation()
Create the Bilinear Interpolation object.
Definition and Implementation of the Bilinear Interpolation Layer.
void Backward(const arma::Mat< eT > &&, arma::Mat< eT > &&gradient, arma::Mat< eT > &&output)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...