code: def transformed_retrace(
      q_tm1: Array,
      q_t: Array,
      a_tm1: Array,
      a_t: Array,
      r_t: Array,
      discount_t: Array,
      pi_t: Array,
      mu_t: Array,
      lambda_: float,
      eps: float = 1e-8,
      stop_target_gradients: bool = True,
      tx_pair: TxPair = IDENTITY_PAIR,
  ) -> Array:
      """Calculates transformed Retrace errors.
  
      See "Recurrent Experience Replay in Distributed Reinforcement Learning" by
      Kapturowski et al. (https://openreview.net/pdf?id=r1lyTjAqYX).
  
      Args:
        q_tm1: Q-values at time t-1.
        q_t: Q-values at time t.
        a_tm1: action index at time t-1.
        a_t: action index at time t.
        r_t: reward at time t.
        discount_t: discount at time t.
        pi_t: target policy probs at time t.
        mu_t: behavior policy probs at time t.
        lambda_: scalar mixing parameter lambda.
        eps: small value to add to mu_t for numerical stability.
        stop_target_gradients: bool indicating whether or not to apply stop gradient
          to targets.
        tx_pair: TxPair of value function transformation and its inverse.
  
      Returns:
        Transformed Retrace error.
      """
      chex.assert_rank(
          [q_tm1, q_t, a_tm1, a_t, r_t, discount_t, pi_t, mu_t],
          [2, 2, 1, 1, 1, 1, 2, 1],
      )
      chex.assert_type(
          [q_tm1, q_t, a_tm1, a_t, r_t, discount_t, pi_t, mu_t],
          [float, float, int, int, float, float, float, float],
      )
  
      pi_a_t = base.batched_index(pi_t, a_t)
      c_t = jnp.minimum(1.0, pi_a_t / (mu_t + eps)) * lambda_
      target_tm1 = (
          transformed_general_off_policy_returns_from_action_values(
              tx_pair,
              q_t,
              a_t,
              r_t,
              discount_t,
              c_t,
              pi_t,
              stop_target_gradients,
          )
      )
      q_a_tm1 = base.batched_index(q_tm1, a_tm1)
      return target_tm1 - q_a_tm1
  
file_path: rlax/rlax/_src/nonlinear_bellman.py
imports: import collections
  import functools
  import chex
  import jax.numpy
  from rlax._src import base
  from rlax._src import multistep
  from rlax._src import transforms
label_desc: Use image node_id 7 for calling a global function with example usage: transformed_retrace(q_tm1, q_t, a_tm1, a_t, r_t, discount_t, pi_t, mu_t, lambda_, eps, stop_target_gradients, tx_pair) and returns: unknown