bilinear_interpolation.hpp
Go to the documentation of this file.
1 
11 #ifndef MLPACK_METHODS_ANN_LAYER_BILINEAR_INTERPOLATION_HPP
12 #define MLPACK_METHODS_ANN_LAYER_BILINEAR_INTERPOLATION_HPP
13 
14 #include <mlpack/prereqs.hpp>
15 
16 namespace mlpack {
17 namespace ann {
18 
35 template <
36  typename InputDataType = arma::mat,
37  typename OutputDataType = arma::mat
38 >
40 {
41  public:
44 
54  BilinearInterpolation(const size_t inRowSize,
55  const size_t inColSize,
56  const size_t outRowSize,
57  const size_t outColSize,
58  const size_t depth);
59 
67  template<typename eT>
68  void Forward(const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
69 
81  template<typename eT>
82  void Backward(const arma::Mat<eT>&& /*input*/,
83  arma::Mat<eT>&& gradient,
84  arma::Mat<eT>&& output);
85 
87  OutputDataType const& OutputParameter() const { return outputParameter; }
89  OutputDataType& OutputParameter() { return outputParameter; }
90 
92  OutputDataType const& Delta() const { return delta; }
94  OutputDataType& Delta() { return delta; }
95 
99  template<typename Archive>
100  void serialize(Archive& ar, const unsigned int /* version */);
101 
102  private:
104  size_t inRowSize;
106  size_t inColSize;
108  size_t outRowSize;
110  size_t outColSize;
112  size_t depth;
114  size_t batchSize;
116  OutputDataType delta;
118  OutputDataType outputParameter;
119 }; // class BilinearInterpolation
120 
121 } // namespace ann
122 } // namespace mlpack
123 
124 // Include implementation.
125 #include "bilinear_interpolation_impl.hpp"
126 
127 #endif
OutputDataType const & OutputParameter() const
Get the output parameter.
.hpp
Definition: add_to_po.hpp:21
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.
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...