mlpack 3.4.2
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
16namespace mlpack {
17namespace ann {
18
35template <
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 const 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
97 size_t const& InRowSize() const { return inRowSize; }
99 size_t& InRowSize() { return inRowSize; }
100
102 size_t const& InColSize() const { return inColSize; }
104 size_t& InColSize() { return inColSize; }
105
107 size_t const& OutRowSize() const { return outRowSize; }
109 size_t& OutRowSize() { return outRowSize; }
110
112 size_t const& OutColSize() const { return outColSize; }
114 size_t& OutColSize() { return outColSize; }
115
117 size_t const& InDepth() const { return depth; }
119 size_t& InDepth() { return depth; }
120
124 template<typename Archive>
125 void serialize(Archive& ar, const unsigned int /* version */);
126
127 private:
129 size_t inRowSize;
131 size_t inColSize;
133 size_t outRowSize;
135 size_t outColSize;
137 size_t depth;
139 size_t batchSize;
141 OutputDataType delta;
143 OutputDataType outputParameter;
144}; // class BilinearInterpolation
145
146} // namespace ann
147} // namespace mlpack
148
149// Include implementation.
150#include "bilinear_interpolation_impl.hpp"
151
152#endif
Definition and Implementation of the Bilinear Interpolation Layer.
size_t const & OutColSize() const
Get the column size of the output.
OutputDataType const & Delta() const
Get the delta.
size_t & InDepth()
Modify the depth of the input.
size_t const & InColSize() const
Get the column size of the input.
size_t const & InDepth() const
Get the depth of the input.
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Forward pass through the layer.
OutputDataType const & OutputParameter() const
Get the output parameter.
void Backward(const arma::Mat< eT > &, const 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...
BilinearInterpolation()
Create the Bilinear Interpolation object.
size_t const & OutRowSize() const
Get the row size of the output.
size_t & InRowSize()
Modify the row size of the input.
size_t & OutColSize()
Modify the column size of the output.
BilinearInterpolation(const size_t inRowSize, const size_t inColSize, const size_t outRowSize, const size_t outColSize, const size_t depth)
The constructor for the Bilinear Interpolation.
OutputDataType & OutputParameter()
Modify the output parameter.
size_t & InColSize()
Modify the column size of the input.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
size_t & OutRowSize()
Modify the row size of the output.
OutputDataType & Delta()
Modify the delta.
size_t const & InRowSize() const
Get the row size of the input.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.