BicubicInterpolation< InputDataType, OutputDataType > Class Template Reference

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

Public Member Functions

 BicubicInterpolation ()
 Create the Bicubic Interpolation object. More...

 
 BicubicInterpolation (const size_t inRowSize, const size_t inColSize, const size_t outRowSize, const size_t outColSize, const size_t depth, const double alpha=-0.75)
 The constructor for the Bicubic Interpolation. More...

 
double const & Alpha () const
 Get the constant value to generate weight. More...

 
double & Alpha ()
 Modify the constant value to generate weight. More...

 
template
<
typename
eT
>
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 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...

 
void GetKernalWeight (double delta, arma::mat &coeffs)
 
size_t const & InColSize () const
 Get the column size of the input. More...

 
size_t & InColSize ()
 Modify the column size of the input. More...

 
size_t const & InDepth () const
 Get the depth of the input. More...

 
size_t & InDepth ()
 Modify the depth of the input. More...

 
size_t InputShape () const
 Get the shape of the input. More...

 
size_t const & InRowSize () const
 Get the row size of the input. More...

 
size_t & InRowSize ()
 Modify the row size of the input. More...

 
size_t const & OutColSize () const
 Get the column size of the output. More...

 
size_t & OutColSize ()
 Modify the column size of the output. More...

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

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

 
size_t const & OutRowSize () const
 Get the row size of the output. More...

 
size_t & OutRowSize ()
 Modify the row size of the output. More...

 
OutputDataType const & Parameters () const
 Get the parameters. More...

 
OutputDataType & Parameters ()
 Modify the parameters. More...

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

 

Detailed Description


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

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

Definition and Implementation of the Bicubic Interpolation Layer.

Bicubic Interpolation is an mathematical technique, primarily used for scaling purposes. It is an extension of cubic interpolation, for interpolating functions of two variables on a rectangular grid. The key idea is to perform cubic 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 38 of file bicubic_interpolation.hpp.

Constructor & Destructor Documentation

◆ BicubicInterpolation() [1/2]

Create the Bicubic Interpolation object.

◆ BicubicInterpolation() [2/2]

BicubicInterpolation ( const size_t  inRowSize,
const size_t  inColSize,
const size_t  outRowSize,
const size_t  outColSize,
const size_t  depth,
const double  alpha = -0.75 
)

The constructor for the Bicubic 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

◆ Alpha() [1/2]

double const& Alpha ( ) const
inline

Get the constant value to generate weight.

Definition at line 129 of file bicubic_interpolation.hpp.

◆ Alpha() [2/2]

double& Alpha ( )
inline

Modify the constant value to generate weight.

Definition at line 131 of file bicubic_interpolation.hpp.

◆ Backward()

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 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
*(input) The 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 94 of file bicubic_interpolation.hpp.

◆ Delta() [2/2]

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 96 of file bicubic_interpolation.hpp.

◆ 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 Bicubic Interpolation method.

Parameters
inputThe input matrix.
outputThe resulting interpolated output matrix.

◆ GetKernalWeight()

void GetKernalWeight ( double  delta,
arma::mat &  coeffs 
)

◆ InColSize() [1/2]

size_t const& InColSize ( ) const
inline

Get the column size of the input.

Definition at line 109 of file bicubic_interpolation.hpp.

◆ InColSize() [2/2]

size_t& InColSize ( )
inline

Modify the column size of the input.

Definition at line 111 of file bicubic_interpolation.hpp.

◆ InDepth() [1/2]

size_t const& InDepth ( ) const
inline

Get the depth of the input.

Definition at line 124 of file bicubic_interpolation.hpp.

◆ InDepth() [2/2]

size_t& InDepth ( )
inline

Modify the depth of the input.

Definition at line 126 of file bicubic_interpolation.hpp.

◆ InputShape()

size_t InputShape ( ) const
inline

Get the shape of the input.

Definition at line 134 of file bicubic_interpolation.hpp.

References BicubicInterpolation< InputDataType, OutputDataType >::serialize().

◆ InRowSize() [1/2]

size_t const& InRowSize ( ) const
inline

Get the row size of the input.

Definition at line 104 of file bicubic_interpolation.hpp.

◆ InRowSize() [2/2]

size_t& InRowSize ( )
inline

Modify the row size of the input.

Definition at line 106 of file bicubic_interpolation.hpp.

◆ OutColSize() [1/2]

size_t const& OutColSize ( ) const
inline

Get the column size of the output.

Definition at line 119 of file bicubic_interpolation.hpp.

◆ OutColSize() [2/2]

size_t& OutColSize ( )
inline

Modify the column size of the output.

Definition at line 121 of file bicubic_interpolation.hpp.

◆ OutputParameter() [1/2]

OutputDataType const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 89 of file bicubic_interpolation.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 91 of file bicubic_interpolation.hpp.

◆ OutRowSize() [1/2]

size_t const& OutRowSize ( ) const
inline

Get the row size of the output.

Definition at line 114 of file bicubic_interpolation.hpp.

◆ OutRowSize() [2/2]

size_t& OutRowSize ( )
inline

Modify the row size of the output.

Definition at line 116 of file bicubic_interpolation.hpp.

◆ Parameters() [1/2]

OutputDataType const& Parameters ( ) const
inline

Get the parameters.

Definition at line 99 of file bicubic_interpolation.hpp.

◆ Parameters() [2/2]

OutputDataType& Parameters ( )
inline

Modify the parameters.

Definition at line 101 of file bicubic_interpolation.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)

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