mlpack
Public Member Functions | List of all members
mlpack::ann::PixelShuffle< InputDataType, OutputDataType > Class Template Reference

Implementation of the PixelShuffle layer. More...

#include <pixel_shuffle.hpp>

Public Member Functions

 PixelShuffle ()
 Create the PixelShuffle object.
 
 PixelShuffle (const size_t upscaleFactor, const size_t height, const size_t width, const size_t size)
 Create the PixelShuffle object using the specified parameters. More...
 
template<typename eT >
void Forward (const arma::Mat< eT > &input, arma::Mat< eT > &output)
 Ordinary feed forward pass of the PixelShuffle layer. More...
 
template<typename eT >
void Backward (const arma::Mat< eT > &input, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
 Ordinary feed backward pass of the PixelShuffle layer. More...
 
OutputDataType const & OutputParameter () const
 Get the output parameter.
 
OutputDataType & OutputParameter ()
 Modify the output parameter.
 
OutputDataType const & Delta () const
 Get the delta.
 
OutputDataType & Delta ()
 Modify the delta.
 
size_t UpscaleFactor () const
 Get the upscale factor.
 
size_t & UpscaleFactor ()
 Modify the upscale factor.
 
size_t InputHeight () const
 Get the input image height.
 
size_t & InputHeight ()
 Modify the input image height.
 
size_t InputWidth () const
 Get the input image width.
 
size_t & InputWidth ()
 Modify the input image width.
 
size_t InputChannels () const
 Get the number of input channels.
 
size_t & InputChannels ()
 Modify the number of input channels.
 
size_t OutputHeight () const
 Get the output image height.
 
size_t OutputWidth () const
 Get the output image width.
 
size_t OutputChannels () const
 Get the number of output channels.
 
template<typename Archive >
void serialize (Archive &ar, const unsigned int)
 Serialize the layer.
 

Detailed Description

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::PixelShuffle< InputDataType, OutputDataType >

Implementation of the PixelShuffle layer.

For more information, refer to the following paper,

@article{Shi16,
author = {Wenzhe Shi, Jose Caballero,Ferenc Huszár, Johannes Totz,
Andrew P. Aitken, Rob Bishop, Daniel Rueckert, Zehan Wang},
title = {Real-Time Single Image and Video Super-Resolution Using an
Efficient Sub-Pixel Convolutional Neural Network},
journal = {CoRR},
volume = {abs/1609.05158},
year = {2016},
url = {https://arxiv.org/abs/1609.05158},
eprint = {1609.05158},
}
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).

Constructor & Destructor Documentation

◆ PixelShuffle()

template<typename InputDataType , typename OutputDataType >
mlpack::ann::PixelShuffle< InputDataType, OutputDataType >::PixelShuffle ( const size_t  upscaleFactor,
const size_t  height,
const size_t  width,
const size_t  size 
)

Create the PixelShuffle object using the specified parameters.

The number of input channels should be an integral multiple of the square of the upscale factor.

Parameters
upscaleFactorThe scaling factor for Pixel Shuffle.
heightThe height of each input image.
widthThe width of each input image.
sizeThe number of channels of each input image.

Member Function Documentation

◆ Backward()

template<typename InputDataType , typename OutputDataType >
template<typename eT >
void mlpack::ann::PixelShuffle< InputDataType, OutputDataType >::Backward ( const arma::Mat< eT > &  input,
const arma::Mat< eT > &  gy,
arma::Mat< eT > &  g 
)

Ordinary feed backward pass of the PixelShuffle layer.

Parameters
inputThe propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.

◆ Forward()

template<typename InputDataType , typename OutputDataType >
template<typename eT >
void mlpack::ann::PixelShuffle< InputDataType, OutputDataType >::Forward ( const arma::Mat< eT > &  input,
arma::Mat< eT > &  output 
)

Ordinary feed forward pass of the PixelShuffle layer.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.

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