docstr: Tests SAC's (cont. actions) compute_log_likelihoods method.
docstr_tok: ["Tests","SAC","'s","(","cont",".","actions",")","compute_log_likelihoods","method","."]
code: def test_sac_cont(self):
      """Tests SAC's (cont. actions) compute_log_likelihoods method."""
      config = sac.SACConfig()
      config.training(
          policy_model_config={
              "fcnet_hiddens": [10],
              "fcnet_activation": "linear",
          }
      )
      config.debugging(seed=42)
      prev_a = np.array([0.0])
  
      # SAC cont uses a squashed normal distribution. Implement it's logp
      # logic here in numpy for comparing results.
      def logp_func(means, log_stds, values, low=-1.0, high=1.0):
          stds = np.exp(
              np.clip(log_stds, MIN_LOG_NN_OUTPUT, MAX_LOG_NN_OUTPUT)
          )
          unsquashed_values = np.arctanh(
              (values - low) / (high - low) * 2.0 - 1.0
          )
          log_prob_unsquashed = np.sum(
              np.log(norm.pdf(unsquashed_values, means, stds)), -1
          )
          return log_prob_unsquashed - np.sum(
              np.log(1 - np.tanh(unsquashed_values) ** 2), axis=-1
          )
  
      do_test_log_likelihood(
          sac.SAC,
          config,
          prev_a,
          continuous=True,
          layer_key=(
              "fc",
              (0, 2),
              (
                  "action_model._hidden_layers.0.",
                  "action_model._logits.",
              ),
          ),
          logp_func=logp_func,
      )
  
imports: import unittest
  import numpy
  from scipy.stats import norm
  import ray
  import ray.rllib.algorithms.dqn
  import ray.rllib.algorithms.ppo
  import ray.rllib.algorithms.sac
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.numpy import MAX_LOG_NN_OUTPUT, MIN_LOG_NN_OUTPUT, fc, one_hot
  from ray.rllib.utils.test_utils import check, framework_iterator
label_desc: Use image node_id 6 for calling the TestComputeLogLikelihood obj's underlying member method code with example usage: obj.test_sac_cont() and returns: unknown