class_docstr: ### Description
      This predicts the mean and logvariance parameters,
      then generates an approximate sample from the posterior.
  
  ### Diagram
  
  ### Constraints
class_docstr_tok: ["#","#","#","Description","This","predicts","the","mean","and","logvariance","parameters",",","then","generates","an","approximate","sample","from","the","posterior",".","#","#","#","Diagram","#","#","#","Constraints"]
docstr: :param number_of_latent_variables: int, number of output channels for FC layer
  :param number_of_samples_from_posterior: int, number of samples to draw from standard gaussian
  :param logvars_upper_bound: upper bound of log of variances for clipping
  :param logvars_lower_bound: lower bound of log of variances for clipping
  :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","number_of_latent_variables",":","int",",","number","of","output","channels","for","FC","layer",":","param","number_of_samples_from_posterior",":","int",",","number","of","samples","to","draw","from","standard","gaussian",":","param","logvars_upper_bound",":","upper","bound","of","log","of","variances","for","clipping",":","param","logvars_lower_bound",":","lower","bound","of","log","of","variances","for","clipping",":","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,
      number_of_latent_variables,
      number_of_samples_from_posterior,
      logvars_upper_bound,
      logvars_lower_bound,
      w_initializer=None,
      w_regularizer=None,
      b_initializer=None,
      b_regularizer=None,
      name="gaussian_sampler",
  ):
      """
  
      :param number_of_latent_variables: int, number of output channels for FC layer
      :param number_of_samples_from_posterior: int, number of samples to draw from standard gaussian
      :param logvars_upper_bound: upper bound of log of variances for clipping
      :param logvars_lower_bound: lower bound of log of variances for clipping
      :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(GaussianSampler, self).__init__(name=name)
  
      self.number_of_latent_variables = number_of_latent_variables
      self.number_of_samples = number_of_samples_from_posterior
      self.logvars_upper_bound = logvars_upper_bound
      self.logvars_lower_bound = logvars_lower_bound
  
      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 GaussianSampler object from inherited base classes: TrainableLayer with example: obj = GaussianSampler(number_of_latent_variables, number_of_samples_from_posterior, logvars_upper_bound, logvars_lower_bound, w_initializer, w_regularizer, b_initializer, b_regularizer, name)