class_docstr: Computes the regret with respect to a baseline.
class_docstr_tok: ["Computes","the","regret","with","respect","to","a","baseline","."]
docstr: Update the regret value.
  
  Args:
    trajectory: A tf_agents.trajectory.Trajectory
  
  Returns:
    The arguments, for easy chaining.
docstr_tok: ["Update","the","regret","value",".","Args",":","trajectory",":","A","tf_agents.trajectory.Trajectory","Returns",":","The","arguments",",","for","easy","chaining","."]
code: def call(self, trajectory):
      """Update the regret value.
  
      Args:
        trajectory: A tf_agents.trajectory.Trajectory
  
      Returns:
        The arguments, for easy chaining.
      """
      baseline_reward = self._baseline_reward_fn(trajectory.observation)
      trajectory_reward = trajectory.reward
      if isinstance(trajectory.reward, dict):
          trajectory_reward = trajectory.reward[
              bandit_spec_utils.REWARD_SPEC_KEY
          ]
      trajectory_regret = baseline_reward - trajectory_reward
      self.regret.assign(tf.reduce_mean(trajectory_regret))
      return trajectory
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Callable, Optional, Text
  import gin
  import tensorflow
  from tf_agents.bandits.policies import constraints
  from tf_agents.bandits.specs import utils
  from tf_agents.metrics import tf_metric
  from tf_agents.typing import types
  from tf_agents.utils import common
label_desc: Use image node_id 2 for calling the RegretMetric obj's underlying member method code with example usage: obj.call(trajectory) and returns: trajectory