code: def ExplainedVariance(values, returns):
      """Definition of explained variance - an approach from OpenAI baselines."""
      assert (
          returns.shape == values.shape
      ), f"returns.shape was {returns.shape} and values.shape was {values.shape}"
      # TODO(henrykm): it would be good to explain the relation with the time dim.
      returns_variance = jnp.var(returns)
      explained_variance = (
          1 - jnp.var(returns - values) / returns_variance
      )
      return explained_variance
  
file_path: trax/trax/rl/rl_layers.py
imports: from trax.fastmath import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: ExplainedVariance(values, returns) and returns: explained_variance