PixelShuffle< InputDataType, OutputDataType > Class Template Reference

Implementation of the PixelShuffle layer. More...

Public Member Functions

 PixelShuffle ()
 Create the PixelShuffle object. More...

 
 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 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 & 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)
 Ordinary feed forward pass of the PixelShuffle layer. More...

 
size_t InputChannels () const
 Get the number of input channels. More...

 
size_t & InputChannels ()
 Modify the number of input channels. More...

 
size_t InputHeight () const
 Get the input image height. More...

 
size_t & InputHeight ()
 Modify the input image height. More...

 
size_t InputWidth () const
 Get the input image width. More...

 
size_t & InputWidth ()
 Modify the input image width. More...

 
size_t OutputChannels () const
 Get the number of output channels. More...

 
size_t OutputHeight () const
 Get the output image height. More...

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

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

 
size_t OutputWidth () const
 Get the output image width. More...

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

 
size_t UpscaleFactor () const
 Get the upscale factor. More...

 
size_t & UpscaleFactor ()
 Modify the upscale factor. More...

 

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

Definition at line 49 of file pixel_shuffle.hpp.

Constructor & Destructor Documentation

◆ PixelShuffle() [1/2]

Create the PixelShuffle object.

◆ PixelShuffle() [2/2]

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()

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

◆ Delta() [1/2]

OutputDataType const& Delta ( ) const
inline

Get the delta.

Definition at line 97 of file pixel_shuffle.hpp.

◆ Delta() [2/2]

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 99 of file pixel_shuffle.hpp.

◆ Forward()

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

◆ InputChannels() [1/2]

size_t InputChannels ( ) const
inline

Get the number of input channels.

Definition at line 120 of file pixel_shuffle.hpp.

◆ InputChannels() [2/2]

size_t& InputChannels ( )
inline

Modify the number of input channels.

Definition at line 123 of file pixel_shuffle.hpp.

◆ InputHeight() [1/2]

size_t InputHeight ( ) const
inline

Get the input image height.

Definition at line 108 of file pixel_shuffle.hpp.

◆ InputHeight() [2/2]

size_t& InputHeight ( )
inline

Modify the input image height.

Definition at line 111 of file pixel_shuffle.hpp.

◆ InputWidth() [1/2]

size_t InputWidth ( ) const
inline

Get the input image width.

Definition at line 114 of file pixel_shuffle.hpp.

◆ InputWidth() [2/2]

size_t& InputWidth ( )
inline

Modify the input image width.

Definition at line 117 of file pixel_shuffle.hpp.

◆ OutputChannels()

size_t OutputChannels ( ) const
inline

Get the number of output channels.

Definition at line 132 of file pixel_shuffle.hpp.

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

◆ OutputHeight()

size_t OutputHeight ( ) const
inline

Get the output image height.

Definition at line 126 of file pixel_shuffle.hpp.

◆ OutputParameter() [1/2]

OutputDataType const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 92 of file pixel_shuffle.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 94 of file pixel_shuffle.hpp.

◆ OutputWidth()

size_t OutputWidth ( ) const
inline

Get the output image width.

Definition at line 129 of file pixel_shuffle.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)

◆ UpscaleFactor() [1/2]

size_t UpscaleFactor ( ) const
inline

Get the upscale factor.

Definition at line 102 of file pixel_shuffle.hpp.

◆ UpscaleFactor() [2/2]

size_t& UpscaleFactor ( )
inline

Modify the upscale factor.

Definition at line 105 of file pixel_shuffle.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/ann/layer/pixel_shuffle.hpp