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 __init__(
      self,
      *,
      stddev_mode="predicted",
      bounded_transform="tanh",
      name=None,
      action_spec=None,
      input_spec=None,
  ):
      assert action_spec.type == "float"
  
      parameters_spec = TensorsSpec(
          mean=TensorSpec(type="float", shape=action_spec.shape),
          stddev=TensorSpec(type="float", shape=action_spec.shape),
          log_stddev=TensorSpec(type="float", shape=action_spec.shape),
      )
      conditions_spec = TensorsSpec()
  
      super().__init__(
          name=name,
          action_spec=action_spec,
          input_spec=input_spec,
          parameters_spec=parameters_spec,
          conditions_spec=conditions_spec,
      )
  
      self.stddev_mode = stddev_mode
  
      if bounded_transform is None:
          bounded_transform = "tanh"
      if bounded_transform not in ("clipping", "tanh"):
          raise TensorforceError.value(
              name="Gaussian",
              argument="bounded_transform",
              value=bounded_transform,
              hint="not in {clipping,tanh}",
          )
      elif bounded_transform == "tanh" and (
          (self.action_spec.min_value is not None)
          is not (self.action_spec.max_value is not None)
      ):
          raise TensorforceError.value(
              name="Gaussian",
              argument="bounded_transform",
              value=bounded_transform,
              condition="one-sided bounded action space",
          )
      elif (
          self.action_spec.min_value is None
          and self.action_spec.max_value is None
      ):
          bounded_transform = None
      self.bounded_transform = bounded_transform
  
      if self.input_spec.rank == 1:
          # Single embedding
          self.mean = self.submodule(
              name="mean",
              module="linear",
              modules=layer_modules,
              size=self.action_spec.size,
              initialization_scale=0.01,
              input_spec=self.input_spec,
          )
          if self.stddev_mode == "predicted":
              self.stddev = self.submodule(
                  name="stddev",
                  module="linear",
                  modules=layer_modules,
                  size=self.action_spec.size,
                  initialization_scale=0.01,
                  input_spec=self.input_spec,
              )
  
      else:
          # Embedding per action
          if self.input_spec.rank < 1 or self.input_spec.rank > 3:
              raise TensorforceError.value(
                  name=name,
                  argument="input_spec.shape",
                  value=self.embedding_shape,
                  hint="invalid rank",
              )
          elif (
              self.input_spec.shape[:-1] == self.action_spec.shape[:-1]
          ):
              size = self.action_spec.shape[-1]
          elif self.input_spec.shape[:-1] == self.action_spec.shape:
              size = 0
          else:
              raise TensorforceError.value(
                  name=name,
                  argument="input_spec.shape",
                  value=self.input_spec.shape,
                  hint="not flattened and incompatible with action shape",
              )
          self.mean = self.submodule(
              name="mean",
              module="linear",
              modules=layer_modules,
              size=size,
              initialization_scale=0.01,
              input_spec=self.input_spec,
          )
          if self.stddev_mode == "predicted":
              self.stddev = self.submodule(
                  name="stddev",
                  module="linear",
                  modules=layer_modules,
                  size=size,
                  initialization_scale=0.01,
                  input_spec=self.input_spec,
              )
  
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 1 to create a new Gaussian object from inherited base classes: Distribution with example: obj = Gaussian()