class_docstr: Replay buffer for HER (Hindsight Experience Replay).
  
  It constructs hindsight examples using future strategy.
  
  Args:
      replay_k (int): Number of HER transitions to add for each regular
          Transition. Setting this to 0 means that no HER replays will
          be added.
      reward_fn (callable): Function to re-compute the reward with
          substituted goals.
      capacity_in_transitions (int): total size of transitions in the buffer.
      env_spec (EnvSpec): Environment specification.
class_docstr_tok: ["Replay","buffer","for","HER","(","Hindsight","Experience","Replay",")",".","It","constructs","hindsight","examples","using","future","strategy",".","Args",":","replay_k","(","int",")",":","Number","of","HER","transitions","to","add","for","each","regular","Transition",".","Setting","this","to","0","means","that","no","HER","replays","will","be","added",".","reward_fn","(","callable",")",":","Function","to","re-compute","the","reward","with","substituted","goals",".","capacity_in_transitions","(","int",")",":","total","size","of","transitions","in","the","buffer",".","env_spec","(","EnvSpec",")",":","Environment","specification","."]
code: def __init__(
      self, replay_k, reward_fn, capacity_in_transitions, env_spec
  ):
      self._replay_k = replay_k
      self._reward_fn = reward_fn
  
      if not float(replay_k).is_integer() or replay_k < 0:
          raise ValueError("replay_k must be an integer and >= 0.")
      super().__init__(capacity_in_transitions, env_spec)
  
file_path: garage/src/garage/replay_buffer/her_replay_buffer.py
imports: import copy
  import numpy
  from garage.replay_buffer.path_buffer import PathBuffer
label_desc: Use image node_id 1 to create a new HERReplayBuffer object from inherited base classes: PathBuffer with example: obj = HERReplayBuffer(replay_k, reward_fn, capacity_in_transitions, env_spec)