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... | |
Implementation of the PixelShuffle layer.
For more information, refer to the following paper,
InputDataType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 49 of file pixel_shuffle.hpp.
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.
The number of input channels should be an integral multiple of the square of the upscale factor.
upscaleFactor | The scaling factor for Pixel Shuffle. |
height | The height of each input image. |
width | The width of each input image. |
size | The number of channels of each input image. |
void Backward | ( | const arma::Mat< eT > & | input, |
const arma::Mat< eT > & | gy, | ||
arma::Mat< eT > & | g | ||
) |
Ordinary feed backward pass of the PixelShuffle layer.
input | The propagated input activation. |
gy | The backpropagated error. |
g | The calculated gradient. |
|
inline |
Get the delta.
Definition at line 97 of file pixel_shuffle.hpp.
|
inline |
Modify the delta.
Definition at line 99 of file pixel_shuffle.hpp.
void Forward | ( | const arma::Mat< eT > & | input, |
arma::Mat< eT > & | output | ||
) |
Ordinary feed forward pass of the PixelShuffle layer.
input | Input data used for evaluating the specified function. |
output | Resulting output activation. |
|
inline |
Get the number of input channels.
Definition at line 120 of file pixel_shuffle.hpp.
|
inline |
Modify the number of input channels.
Definition at line 123 of file pixel_shuffle.hpp.
|
inline |
Get the input image height.
Definition at line 108 of file pixel_shuffle.hpp.
|
inline |
Modify the input image height.
Definition at line 111 of file pixel_shuffle.hpp.
|
inline |
Get the input image width.
Definition at line 114 of file pixel_shuffle.hpp.
|
inline |
Modify the input image width.
Definition at line 117 of file pixel_shuffle.hpp.
|
inline |
Get the number of output channels.
Definition at line 132 of file pixel_shuffle.hpp.
References PixelShuffle< InputDataType, OutputDataType >::serialize().
|
inline |
Get the output image height.
Definition at line 126 of file pixel_shuffle.hpp.
|
inline |
Get the output parameter.
Definition at line 92 of file pixel_shuffle.hpp.
|
inline |
Modify the output parameter.
Definition at line 94 of file pixel_shuffle.hpp.
|
inline |
Get the output image width.
Definition at line 129 of file pixel_shuffle.hpp.
void serialize | ( | Archive & | ar, |
const unsigned | int | ||
) |
Serialize the layer.
Referenced by PixelShuffle< InputDataType, OutputDataType >::OutputChannels().
|
inline |
Get the upscale factor.
Definition at line 102 of file pixel_shuffle.hpp.
|
inline |
Modify the upscale factor.
Definition at line 105 of file pixel_shuffle.hpp.