class_docstr: Generates a tanh-squashed MultivariateNormalDiag distribution.
  
  Note: Due to the nature of the `tanh` function, values near the spec bounds
  cannot be returned.
class_docstr_tok: ["Generates","a","tanh-squashed","MultivariateNormalDiag","distribution",".","Note",":","Due","to","the","nature","of","the","`","tanh","`","function",",","values","near","the","spec","bounds","can","not","be","returned","."]
docstr: Creates an instance of TanhNormalProjectionNetwork.
  
  Args:
    sample_spec: A `tensor_spec.BoundedTensorSpec` detailing the shape and
      dtypes of samples pulled from the output distribution.
    activation_fn: Activation function to use in dense layer.
    std_transform: Transformation function to apply to the stddevs.
    name: A string representing name of the network.
docstr_tok: ["Creates","an","instance","of","TanhNormalProjectionNetwork",".","Args",":","sample_spec",":","A","`","tensor_spec.BoundedTensorSpec","`","detailing","the","shape","and","dtypes","of","samples","pulled","from","the","output","distribution",".","activation_fn",":","Activation","function","to","use","in","dense","layer",".","std_transform",":","Transformation","function","to","apply","to","the","stddevs",".","name",":","A","string","representing","name","of","the","network","."]
code: def __init__(
      self,
      sample_spec: types.TensorSpec,
      activation_fn: Optional[
          Callable[[types.Tensor], types.Tensor]
      ] = None,
      std_transform: Optional[
          Callable[[types.Tensor], types.Tensor]
      ] = tf.exp,
      name: Text = "TanhNormalProjectionNetwork",
  ):
      """Creates an instance of TanhNormalProjectionNetwork.
  
      Args:
        sample_spec: A `tensor_spec.BoundedTensorSpec` detailing the shape and
          dtypes of samples pulled from the output distribution.
        activation_fn: Activation function to use in dense layer.
        std_transform: Transformation function to apply to the stddevs.
        name: A string representing name of the network.
      """
      if len(tf.nest.flatten(sample_spec)) != 1:
          raise ValueError(
              "Tanh Normal Projection network only supports single spec samples."
          )
      output_spec = self._output_distribution_spec(sample_spec, name)
      super(TanhNormalProjectionNetwork, self).__init__(
          # We don't need these, but base class requires them.
          input_tensor_spec=None,
          state_spec=(),
          output_spec=output_spec,
          name=name,
      )
  
      self._sample_spec = sample_spec
      self._std_transform = std_transform
  
      self._projection_layer = tf.keras.layers.Dense(
          sample_spec.shape.num_elements() * 2,
          activation=activation_fn,
          name="projection_layer",
      )
  
file_path: agents/tf_agents/agents/sac/tanh_normal_projection_network.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Callable, Optional, Text
  import gin
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.networks import network
  from tf_agents.networks import utils
  from tf_agents.specs import distribution_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.typing import types
label_desc: Use image node_id 1 to create a new TanhNormalProjectionNetwork object from inherited base classes: network with example: obj = TanhNormalProjectionNetwork(sample_spec, activation_fn, std_transform, name)