class_docstr: Actor Policy with Gaussian exploration noise.
docstr: Builds an GaussianPolicy wrapping wrapped_policy.
  
  Args:
    wrapped_policy: A policy to wrap and add OU noise to.
    scale: Stddev of the Gaussian distribution from which noise is drawn.
    clip: Whether to clip actions to spec. Default True.
    name: The name of this policy.
docstr_tok: ["Builds","an","GaussianPolicy","wrapping","wrapped_policy",".","Args",":","wrapped_policy",":","A","policy","to","wrap","and","add","OU","noise","to",".","scale",":","Stddev","of","the","Gaussian","distribution","from","which","noise","is","drawn",".","clip",":","Whether","to","clip","actions","to","spec",".","Default","True",".","name",":","The","name","of","this","policy","."]
code: def __init__(
      self,
      wrapped_policy: tf_policy.TFPolicy,
      scale: types.Float = 1.0,
      clip: bool = True,
      name: Optional[Text] = None,
  ):
      """Builds an GaussianPolicy wrapping wrapped_policy.
  
      Args:
        wrapped_policy: A policy to wrap and add OU noise to.
        scale: Stddev of the Gaussian distribution from which noise is drawn.
        clip: Whether to clip actions to spec. Default True.
        name: The name of this policy.
      """
  
      def _validate_action_spec(action_spec):
          if not tensor_spec.is_continuous(action_spec):
              raise ValueError(
                  "Gaussian Noise is applicable only to continuous actions."
              )
  
      tf.nest.map_structure(
          _validate_action_spec, wrapped_policy.action_spec
      )
  
      super(GaussianPolicy, self).__init__(
          wrapped_policy.time_step_spec,
          wrapped_policy.action_spec,
          wrapped_policy.policy_state_spec,
          wrapped_policy.info_spec,
          clip=clip,
          name=name,
      )
      self._wrapped_policy = wrapped_policy
  
      def _create_normal_distribution(action_spec):
          return tfd.Normal(
              loc=tf.zeros(action_spec.shape, dtype=action_spec.dtype),
              scale=tf.ones(action_spec.shape, dtype=action_spec.dtype)
              * scale,
          )
  
      self._noise_distribution = tf.nest.map_structure(
          _create_normal_distribution, self._action_spec
      )
  
file_path: agents/tf_agents/policies/gaussian_policy.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Text
  import tensorflow
  import tensorflow_probability
  from tf_agents.policies import tf_policy
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.typing import types
label_desc: Use image node_id 1 to create a new GaussianPolicy object from inherited base classes: tf_policy with example: obj = GaussianPolicy(wrapped_policy, scale, clip, name)