class_docstr: Gaussian distribution, for continuous actions (specification key: `gaussian`).
  
  Args:
      stddev_mode ("predicted" | "global"): Whether to predict the standard deviation via a linear
          transformation of the state embedding, or to parametrize the standard deviation by a
          separate set of trainable weights
          (<span style="color:#00C000"><b>default</b></span>: "predicted").
      bounded_transform ("clipping" | "tanh"): Transformation to adjust sampled actions in case of
          bounded action space, "tanh" transforms distribution (e.g. log probability computation)
          accordingly whereas "clipping" does not
          (<span style="color:#00C000"><b>default</b></span>: tanh).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      action_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      input_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
class_docstr_tok: ["Gaussian","distribution",",","for","continuous","actions","(","specification","key",":","`","gaussian","`",")",".","Args",":","stddev_mode","(","``","predicted","''","|","``","global","''",")",":","Whether","to","predict","the","standard","deviation","via","a","linear","transformation","of","the","state","embedding",",","or","to","parametrize","the","standard","deviation","by","a","separate","set","of","trainable","weights","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","``","predicted","''",")",".","bounded_transform","(","``","clipping","''","|","``","tanh","''",")",":","Transformation","to","adjust","sampled","actions","in","case","of","bounded","action","space",",","``","tanh","''","transforms","distribution","(","e.g",".","log","probability","computation",")","accordingly","whereas","``","clipping","''","does","not","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","tanh",")",".","name","(","string",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","action_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def action_value(self, *, parameters, action):
      mean, stddev, log_stddev = parameters.get(
          ("mean", "stddev", "log_stddev")
      )
  
      # Inverse bounded transformation
      if self.bounded_transform is not None:
          if (
              self.action_spec.min_value is not None
              and self.action_spec.max_value is not None
          ):
              one = tf_util.constant(value=1.0, dtype="float")
              two = tf_util.constant(value=2.0, dtype="float")
              min_value = tf_util.constant(
                  value=self.action_spec.min_value, dtype="float"
              )
              max_value = tf_util.constant(
                  value=self.action_spec.max_value, dtype="float"
              )
              action = (
                  two * (action - min_value) / (max_value - min_value)
                  - one
              )
  
          if self.bounded_transform == "tanh":
              clip = tf_util.constant(
                  value=(1.0 - util.epsilon), dtype="float"
              )
              action = tf.clip_by_value(
                  t=action, clip_value_min=-clip, clip_value_max=clip
              )
              action = tf.math.atanh(x=action)
  
      half = tf_util.constant(value=0.5, dtype="float")
      two = tf_util.constant(value=2.0, dtype="float")
      epsilon = tf_util.constant(value=util.epsilon, dtype="float")
      log_two_pi = tf_util.constant(
          value=(np.log(2.0 * np.pi)), dtype="float"
      )
      # TODO: why no e here, but for entropy?
  
      sq_mean_distance = tf.square(x=(action - mean))
      sq_stddev = tf.square(x=stddev) + epsilon
  
      action_value = (
          -half * sq_mean_distance / sq_stddev
          - two * log_stddev
          - log_two_pi
      )
  
      # Probably not needed?
      # if self.bounded_transform == 'tanh':
      #     log_two = tf_util.constant(value=np.log(2.0), dtype='float')
      #     action_value -= two * (log_two - action - tf.math.softplus(features=(-two * action)))
  
      return action_value
  
file_path: tensorforce/tensorforce/core/distributions/gaussian.py
imports: import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core import layer_modules, TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util
  from tensorforce.core.distributions import Distribution
label_desc: Use image node_id 10 for calling the Gaussian obj's underlying member method code with example usage: obj.action_value() and returns: action_value