CSpaceToDepthLayer Class
June 18, 2021 ยท View on GitHub
This class implements a layer that splits images into square blocks of size k x k x Ch and writes the contents of these blocks to the corresponding pixels (1 x 1 x Ch*k*k) of the output images in channel-last ordering.
As a result image of size H x W x Ch is transformed into images of size H/k x W/k x Ch*k*k.
This operation is the inverse function of CDepthToSpaceLayer.
Settings
Block size
void SetBlockSize( int blockSize );
Sets the size of the blocks (k from layer description). The image size along either dimension should be a multiple of this value. The value should be greater than 1.
Trainable parameters
The layer has no trainable parameters.
Inputs
The single input accepts a blob with the images, of the dimensions:
BatchLength * BatchWidth * ListSizeis equal to the number of imagesHeightis the image height; should be a multiple ofGetBlockSize()Widthis the image width; should be a multiple ofGetBlockSize()Depthis equal to1Channelsis the number of channels in the image format
Outputs
The single output contains a blob with the resulting images, of the dimensions:
BatchLengthis equal to the inputBatchLengthBatchWidthis equal to the inputBatchWidthListSizeis equal to the inputListSizeHeightis equal to the inputHeight / GetBlockSize()Widthis equal to the inputWidth / GetBlockSize()Depthis equal to1Channelsis equal to the inputChannels * GetBlockSize() * GetBlockSize().