class_docstr: Relative Entropy Policy Search.
  
  References
  ----------
  [1] J. Peters, K. Mulling, and Y. Altun, "Relative Entropy Policy Search,"
      Artif. Intell., pp. 1607-1612, 2008.
  
  Example:
      $ python garage/examples/tf/reps_gym_cartpole.py
  
  Args:
      env_spec (EnvSpec): Environment specification.
      policy (garage.tf.policies.StochasticPolicy): Policy.
      baseline (garage.tf.baselines.Baseline): The baseline.
      sampler (garage.sampler.Sampler): Sampler.
      scope (str): Scope for identifying the algorithm.
          Must be specified if running multiple algorithms
          simultaneously, each using different environments
          and policies.
      discount (float): Discount.
      gae_lambda (float): Lambda used for generalized advantage
          estimation.
      center_adv (bool): Whether to rescale the advantages
          so that they have mean 0 and standard deviation 1.
      positive_adv (bool): Whether to shift the advantages
          so that they are always positive. When used in
          conjunction with center_adv the advantages will be
          standardized before shifting.
      fixed_horizon (bool): Whether to fix horizon.
      epsilon (float): Dual func parameter.
      l2_reg_dual (float): Coefficient for dual func l2 regularization.
      l2_reg_loss (float): Coefficient for policy loss l2 regularization.
      optimizer (object): The optimizer of the algorithm. Should be the
          optimizers in garage.tf.optimizers.
      optimizer_args (dict): Arguments of the optimizer.
      dual_optimizer (object): Dual func optimizer.
      dual_optimizer_args (dict): Arguments of the dual optimizer.
      name (str): Name of the algorithm.
code: def __init__(
      self,
      env_spec,
      policy,
      baseline,
      sampler,
      discount=0.99,
      gae_lambda=1,
      center_adv=True,
      positive_adv=False,
      fixed_horizon=False,
      epsilon=0.5,
      l2_reg_dual=0.0,
      l2_reg_loss=0.0,
      optimizer=LBFGSOptimizer,
      optimizer_args=None,
      dual_optimizer=scipy.optimize.fmin_l_bfgs_b,
      dual_optimizer_args=None,
      name="REPS",
  ):
      optimizer_args = optimizer_args or dict(max_opt_itr=_Default(50))
      dual_optimizer_args = dual_optimizer_args or dict(maxiter=50)
  
      self.policy = policy
      self.max_episode_length = env_spec.max_episode_length
  
      self._env_spec = env_spec
      self._baseline = baseline
      self._discount = discount
      self._gae_lambda = gae_lambda
      self._center_adv = center_adv
      self._positive_adv = positive_adv
      self._fixed_horizon = fixed_horizon
  
      self._name = name
      self._name_scope = tf.name_scope(self._name)
      self._old_policy = policy.clone("old_policy")
  
      self._feat_diff = None
      self._param_eta = None
      self._param_v = None
      self._f_dual = None
      self._f_dual_grad = None
      self._f_policy_kl = None
      self._policy_network = None
      self._old_policy_network = None
  
      self._optimizer = make_optimizer(optimizer, **optimizer_args)
      self._dual_optimizer = dual_optimizer
      self._dual_optimizer_args = dual_optimizer_args
      self._epsilon = float(epsilon)
      self._l2_reg_dual = float(l2_reg_dual)
      self._l2_reg_loss = float(l2_reg_loss)
  
      self._episode_reward_mean = collections.deque(maxlen=100)
      self._sampler = sampler
  
      self._init_opt()
  
imports: import collections
  from dowel import logger, tabular
  import numpy
  import scipy.optimize
  import tensorflow
  from garage import _Default, log_performance, make_optimizer
  from garage.np import pad_batch_array
  from garage.np.algos import RLAlgorithm
  from garage.tf import compile_function, flatten_inputs, graph_inputs, new_tensor
  from garage.tf.optimizers import LBFGSOptimizer
label_desc: Use image node_id 1 to create a new REPS object from inherited base classes: RLAlgorithm with example: obj = REPS(env_spec, policy, baseline, sampler, discount, gae_lambda, center_adv, positive_adv, fixed_horizon, epsilon, l2_reg_dual, l2_reg_loss, optimizer, optimizer_args, dual_optimizer, dual_optimizer_args, name)