You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/12/05 16:47:51 UTC

[GitHub] kohr-h opened a new issue #13548: [Feature Request / Proposal] Pixel shuffle layer

kohr-h opened a new issue #13548: [Feature Request / Proposal] Pixel shuffle layer
URL: https://github.com/apache/incubator-mxnet/issues/13548
 
 
   Upsampling based on pixel shuffling has been proposed in the paper [Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network (2016)](https://arxiv.org/abs/1609.05158). The complete method combines a convolution layer, the pixel shuffle operation and a specific initialization to get rid of block artifacts. For the initialization details, see [Checkerboard artifact free sub-pixel convolution: A note on sub-pixel convolution, resize convolution and convolution resize (2017)](https://arxiv.org/abs/1707.02937).
   
   Pixel shuffling in 2D means to reshape a tensor of shape `(N, f1*f2*C, H, W)` to `(N, C, f1*H, f2*W)`, thereby effectively upscaling the images by `(f1, f2)`.
   In MXNet, pixel shuffling could be implemented like this in Python:
   
   ```python
   def hybrid_forward(self, F, x):
           f1, f2 = self._factors
                                                         # (N, f1*f2*C, H, W)
           x = F.reshape(x, (0, -4, -1, f1 * f2, 0, 0))  # (N, C, f1*f2, H, W)
           x = F.reshape(x, (0, 0, -3, 0))               # (N, C, f1*f2*H, W)
           x = F.reshape(x, (0, 0, -4, -1, f2, 0))       # (N, C, f1*H, f2, W)
           x = F.reshape(x, (0, 0, 0, -3))               # (N, C, f1*H, f2*W)
           return x
   ```
   
   Would this be an interesting addition?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services