class_docstr: ### Description
          This is a generic decoder composed of
          fully-connected layers followed by
          {upsampling then transpose convolution} blocks.
          There is no batch normalisation on
          the final transpose convolutional layer.
class_docstr_tok: ["#","#","#","Description","This","is","a","generic","decoder","composed","of","fully-connected","layers","followed","by","{","upsampling","then","transpose","convolution","}","blocks",".","There","is","no","batch","normalisation","on","the","final","transpose","convolutional","layer","."]
docstr: :param layer_sizes_decoder: array, number of output channels for each decoding FC layer
  :param acti_func_decoder: array, activation functions for each decoding FC layer
  :param trans_conv_output_channels: array, number of output channels for each transpose conv layer
  :param trans_conv_kernel_sizes: array, kernel sizes for each transpose conv layer
  :param trans_conv_unpooling_factors: array, stride values for upsampling transpose convolutions
  :param acti_func_trans_conv: array, activation functions for each transpose conv layer
  :param upsampling_mode: string, type of upsampling (Deconvolution, channelwise deconvolution, replicate)
  :param downsampled_shape: array, final encoded shape before FC in encoder
  :param w_initializer: weight initialisation for network
  :param w_regularizer: weight regularisation for network
  :param b_initializer: bias initialisation for network
  :param b_regularizer: bias regularisation for network
  :param name: layer name
docstr_tok: [":","param","layer_sizes_decoder",":","array",",","number","of","output","channels","for","each","decoding","FC","layer",":","param","acti_func_decoder",":","array",",","activation","functions","for","each","decoding","FC","layer",":","param","trans_conv_output_channels",":","array",",","number","of","output","channels","for","each","transpose","conv","layer",":","param","trans_conv_kernel_sizes",":","array",",","kernel","sizes","for","each","transpose","conv","layer",":","param","trans_conv_unpooling_factors",":","array",",","stride","values","for","upsampling","transpose","convolutions",":","param","acti_func_trans_conv",":","array",",","activation","functions","for","each","transpose","conv","layer",":","param","upsampling_mode",":","string",",","type","of","upsampling","(","Deconvolution",",","channelwise","deconvolution",",","replicate",")",":","param","downsampled_shape",":","array",",","final","encoded","shape","before","FC","in","encoder",":","param","w_initializer",":","weight","initialisation","for","network",":","param","w_regularizer",":","weight","regularisation","for","network",":","param","b_initializer",":","bias","initialisation","for","network",":","param","b_regularizer",":","bias","regularisation","for","network",":","param","name",":","layer","name"]
code: def __init__(
      self,
      layer_sizes_decoder,
      acti_func_decoder,
      trans_conv_output_channels,
      trans_conv_kernel_sizes,
      trans_conv_unpooling_factors,
      acti_func_trans_conv,
      upsampling_mode,
      downsampled_shape,
      w_initializer=None,
      w_regularizer=None,
      b_initializer=None,
      b_regularizer=None,
      name="ConvDecoder",
  ):
      """
  
      :param layer_sizes_decoder: array, number of output channels for each decoding FC layer
      :param acti_func_decoder: array, activation functions for each decoding FC layer
      :param trans_conv_output_channels: array, number of output channels for each transpose conv layer
      :param trans_conv_kernel_sizes: array, kernel sizes for each transpose conv layer
      :param trans_conv_unpooling_factors: array, stride values for upsampling transpose convolutions
      :param acti_func_trans_conv: array, activation functions for each transpose conv layer
      :param upsampling_mode: string, type of upsampling (Deconvolution, channelwise deconvolution, replicate)
      :param downsampled_shape: array, final encoded shape before FC in encoder
      :param w_initializer: weight initialisation for network
      :param w_regularizer: weight regularisation for network
      :param b_initializer: bias initialisation for network
      :param b_regularizer: bias regularisation for network
      :param name: layer name
      """
  
      super(ConvDecoder, self).__init__(name=name)
  
      self.layer_sizes_decoder = layer_sizes_decoder
      self.acti_func_decoder = acti_func_decoder
      self.trans_conv_output_channels = trans_conv_output_channels
      self.trans_conv_kernel_sizes = trans_conv_kernel_sizes
      self.trans_conv_unpooling_factors = trans_conv_unpooling_factors
      self.acti_func_trans_conv = acti_func_trans_conv
      self.upsampling_mode = upsampling_mode
      self.downsampled_shape = downsampled_shape
  
      self.initializers = {"w": w_initializer, "b": b_initializer}
      self.regularizers = {"w": w_regularizer, "b": b_regularizer}
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import tensorflow
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.convolution import ConvolutionalLayer
  from niftynet.layer.deconvolution import DeconvolutionalLayer
  from niftynet.layer.fully_connected import FullyConnectedLayer
  from niftynet.layer.upsample import UpSampleLayer
label_desc: Use image node_id 1 to create a new ConvDecoder object from inherited base classes: TrainableLayer with example: obj = ConvDecoder(layer_sizes_decoder, acti_func_decoder, trans_conv_output_channels, trans_conv_kernel_sizes, trans_conv_unpooling_factors, acti_func_trans_conv, upsampling_mode, downsampled_shape, w_initializer, w_regularizer, b_initializer, b_regularizer, name)