BilinearInterpolation< InputDataType, OutputDataType > Class Template Reference

Definition and Implementation of the Bilinear Interpolation Layer. More...

Public Member Functions

 BilinearInterpolation ()
 Create the Bilinear Interpolation object. More...

 
 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. More...

 
template
<
typename
eT
>
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 backwards through f. More...

 
OutputDataType const & Delta () const
 Get the delta. More...

 
OutputDataType & Delta ()
 Modify the delta. More...

 
template
<
typename
eT
>
void Forward (const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
 Forward pass through the layer. More...

 
OutputDataType const & OutputParameter () const
 Get the output parameter. More...

 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const unsigned int)
 Serialize the layer. More...

 

Detailed Description


template
<
typename
InputDataType
=
arma::mat
,
typename
OutputDataType
=
arma::mat
>

class mlpack::ann::BilinearInterpolation< InputDataType, OutputDataType >

Definition and Implementation of the Bilinear Interpolation Layer.

Bilinear Interpolation is an mathematical technique, primarily used for scaling purposes. It is an extension of linear interpolation, for interpolating functions of two variables on a rectangular grid. The key idea is to perform linear interpolation first in one direction (e.g., along x-axis), and then again in the other direction (i.e., y-axis), on four different known points in the grid. This way, we represent any arbitrary point, present within the grid, as a function of those four points.

Template Parameters
InputDataTypeType of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).
OutputDataTypeType of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).

Definition at line 39 of file bilinear_interpolation.hpp.

Constructor & Destructor Documentation

◆ BilinearInterpolation() [1/2]

Create the Bilinear Interpolation object.

◆ BilinearInterpolation() [2/2]

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.

Parameters
inRowSizeNumber of input rows.
inColSizeNumber of input columns.
outRowSizeNumber of output rows.
outColSizeNumber of output columns.
depthNumber of input slices.

Member Function Documentation

◆ Backward()

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 backwards through f.

Using the results from the feed forward pass. Since the layer does not have any learn-able parameters, we just have to down-sample the gradient to make its size compatible with the input size.

Parameters
inputThe input matrix.
gradientThe computed backward gradient.
outputThe resulting down-sampled output.

◆ Delta() [1/2]

OutputDataType const& Delta ( ) const
inline

Get the delta.

Definition at line 92 of file bilinear_interpolation.hpp.

◆ Delta() [2/2]

OutputDataType& Delta ( )
inline

◆ Forward()

void Forward ( const arma::Mat< eT > &&  input,
arma::Mat< eT > &&  output 
)

Forward pass through the layer.

The layer interpolates the matrix using the given Bilinear Interpolation method.

Parameters
inputThe input matrix.
outputThe resulting interpolated output matrix.

◆ OutputParameter() [1/2]

OutputDataType const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 87 of file bilinear_interpolation.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 89 of file bilinear_interpolation.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)

The documentation for this class was generated from the following file: