parameters: (policy_logits, action_values)
return_statement: return regrets
docstring: Compute regrets using pi and Q.
docstring_summary: Compute regrets using pi and Q.
docstring_tokens: Compute regrets using pi and Q .
function: def compute_regrets(policy_logits, action_values):
    """Compute regrets using pi and Q."""
    # Compute regret.
    policy = tf.nn.softmax(policy_logits, axis=1)
    # Avoid computing gradients for action_values.
    action_values = tf.stop_gradient(action_values)
  
    baseline = compute_baseline(policy, action_values)
  
    regrets = tf.reduce_sum(
        tf.nn.relu(action_values - tf.expand_dims(baseline, 1)), axis=1)
  
    return regrets
function_tokens: def compute_regrets ( policy_logits , action_values ) : # Compute regret. policy = tf . nn . softmax ( policy_logits , axis = 1 ) # Avoid computing gradients for action_values. action_values = tf . stop_gradient ( action_values ) baseline = compute_baseline ( policy , action_values ) regrets = tf . reduce_sum ( tf . nn . relu ( action_values - tf . expand_dims ( baseline , 1 ) ) , axis = 1 ) return regrets