niftynet.layer.subpixel module

class SubPixelLayer(upsample_factor=3, layer_configurations=((5, 64), (3, 32), (3, -1)), acti_func='tanh', with_bn=False, with_bias=True, padding='REFLECT', w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, name='subpixel_cnn')[source]

Bases: niftynet.layer.base_layer.TrainableLayer

Implementation of Shi et al.’s sub-pixel CNN single-image upsampling method.

Based on Shi et al.: “Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network”

__init__(upsample_factor=3, layer_configurations=((5, 64), (3, 32), (3, -1)), acti_func='tanh', with_bn=False, with_bias=True, padding='REFLECT', w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, name='subpixel_cnn')[source]
Parameters:
  • upsample_factor – zoom-factor/image magnification factor
  • layer_configurations – N pairs consisting of a kernel size and

a feature-map size, where N is the number of layers in the net. The last layer must have a feature-map size of -1. :param padding: padding applied in convolutional layers :param with_bias: incorporate bias parameters in convolutional layers :param with_bn: incorporate batch normalisation in convolutional layers :param acti_func: activation function applied to first N - 1 layers

layer_op(lr_images, is_training=True, keep_prob=1.0)[source]