(self)
return tl.Fn('ProbsRatioMean', f)
Joint policy and value loss layer.
Joint policy and value loss layer.
Joint policy and value loss layer .
def probs_ratio_mean(self):
    """Joint policy and value loss layer."""
    def ProbsRatioMean(dist_inputs, actions, old_log_probs):
      """Probability Ratio Mean from the PPO algorithm."""
      probs_ratio = rl_layers.ProbsRatio(
          dist_inputs, actions, old_log_probs,
          log_prob_fun=self._policy_dist.log_prob)
      return jnp.mean(probs_ratio)

    def f(dist_inputs, values, returns, dones, rewards, actions, old_log_probs):
      del values, returns, dones, rewards
      return ProbsRatioMean(dist_inputs, actions, old_log_probs)
    return tl.Fn('ProbsRatioMean', f)
def probs_ratio_mean ( self ) : def ProbsRatioMean ( dist_inputs , actions , old_log_probs ) : """Probability Ratio Mean from the PPO algorithm.""" probs_ratio = rl_layers . ProbsRatio ( dist_inputs , actions , old_log_probs , log_prob_fun = self . _policy_dist . log_prob ) return jnp . mean ( probs_ratio ) def f ( dist_inputs , values , returns , dones , rewards , actions , old_log_probs ) : del values , returns , dones , rewards return ProbsRatioMean ( dist_inputs , actions , old_log_probs ) return tl . Fn ( 'ProbsRatioMean' , f )