class_docstr: This helper makes it easy to read from variables being set with a prior and
  writes values back to the same variables.
  
  Example::
  
      model = ...  # Create a GPflow model
      hmc_helper = SamplingHelper(model.log_posterior_density, model.trainable_parameters)
  
      target_log_prob_fn = hmc_helper.target_log_prob_fn
      current_state = hmc_helper.current_state
  
      hmc = tfp.mcmc.HamiltonianMonteCarlo(target_log_prob_fn=target_log_prob_fn, ...)
      adaptive_hmc = tfp.mcmc.SimpleStepSizeAdaptation(hmc, ...)
  
      @tf.function
      def run_chain_fn():
          return mcmc.sample_chain(
              num_samples, num_burnin_steps, current_state, kernel=adaptive_hmc)
  
      hmc_samples = run_chain_fn()
      parameter_samples = hmc_helper.convert_to_constrained_values(hmc_samples)
docstr: Converts list of unconstrained values in `hmc_samples` to constrained
  versions. Each value in the list corresponds to an entry in parameters
  passed to the constructor; for parameters that have a transform, the
  constrained representation is returned.
docstr_tok: ["Converts","list","of","unconstrained","values","in","`","hmc_samples","`","to","constrained","versions",".","Each","value","in","the","list","corresponds","to","an","entry","in","parameters","passed","to","the","constructor",";","for","parameters","that","have","a","transform",",","the","constrained","representation","is","returned","."]
code: def convert_to_constrained_values(
      self, hmc_samples: Sequence[tf.Tensor]
  ) -> Sequence[tf.Tensor]:
      """
      Converts list of unconstrained values in `hmc_samples` to constrained
      versions. Each value in the list corresponds to an entry in parameters
      passed to the constructor; for parameters that have a transform, the
      constrained representation is returned.
      """
      values = []
      for hmc_value, param in zip(hmc_samples, self._parameters):
          if param.transform is not None:
              value = param.transform.forward(hmc_value)
          else:
              value = hmc_value
          values.append(value)
      return values
  
file_path: GPflow/gpflow/optimizers/mcmc.py
imports: from typing import Callable, Optional, Sequence, Tuple
  import tensorflow
  from gpflow.base import Parameter
label_desc: Use image node_id 4 for calling the SamplingHelper obj's underlying member method code with example usage: obj.convert_to_constrained_values(hmc_samples) and returns: values