docstr: :param func: string, type of operation to perform after convolution (Downsampling, Upsampling, None)
  :param n_chns: array, number of output channels for each convolutional layer of the block
  :param kernels: array, kernel sizes for each convolutional layer of the block
  :param w_initializer: weight initialisation of convolutional layers
  :param w_regularizer: weight regularisation of convolutional layers
  :param with_downsample_branch: boolean, returns also the tensor before func is applied
  :param acti_func: activation function to use
  :param name: layer name
docstr_tok: [":","param","func",":","string",",","type","of","operation","to","perform","after","convolution","(","Downsampling",",","Upsampling",",","None",")",":","param","n_chns",":","array",",","number","of","output","channels","for","each","convolutional","layer","of","the","block",":","param","kernels",":","array",",","kernel","sizes","for","each","convolutional","layer","of","the","block",":","param","w_initializer",":","weight","initialisation","of","convolutional","layers",":","param","w_regularizer",":","weight","regularisation","of","convolutional","layers",":","param","with_downsample_branch",":","boolean",",","returns","also","the","tensor","before","func","is","applied",":","param","acti_func",":","activation","function","to","use",":","param","name",":","layer","name"]
code: def __init__(
      self,
      func,
      n_chns,
      kernels,
      w_initializer=None,
      w_regularizer=None,
      with_downsample_branch=False,
      acti_func="relu",
      name="UNet_block",
  ):
      """
  
      :param func: string, type of operation to perform after convolution (Downsampling, Upsampling, None)
      :param n_chns: array, number of output channels for each convolutional layer of the block
      :param kernels: array, kernel sizes for each convolutional layer of the block
      :param w_initializer: weight initialisation of convolutional layers
      :param w_regularizer: weight regularisation of convolutional layers
      :param with_downsample_branch: boolean, returns also the tensor before func is applied
      :param acti_func: activation function to use
      :param name: layer name
      """
  
      super(UNetBlock, self).__init__(name=name)
  
      self.func = look_up_operations(func.upper(), SUPPORTED_OP)
  
      self.kernels = kernels
      self.n_chns = n_chns
      self.with_downsample_branch = with_downsample_branch
      self.acti_func = acti_func
  
      self.initializers = {"w": w_initializer}
      self.regularizers = {"w": w_regularizer}
  
file_path: NiftyNet/niftynet/network/unet.py
imports: from __future__ import absolute_import, print_function
  from niftynet.layer import layer_util
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.convolution import ConvolutionalLayer
  from niftynet.layer.deconvolution import DeconvolutionalLayer
  from niftynet.layer.downsample import DownSampleLayer
  from niftynet.layer.elementwise import ElementwiseLayer
  from niftynet.layer.crop import CropLayer
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 1 to create a new UNetBlock object from inherited base classes: TrainableLayer with example: obj = UNetBlock(func, n_chns, kernels, w_initializer, w_regularizer, with_downsample_branch, acti_func, name)