garage.replay_buffer.her_replay_buffer module

This module implements a Hindsight Experience Replay (HER).

See: https://arxiv.org/abs/1707.01495.

class HerReplayBuffer(replay_k, reward_fun, **kwargs)[source]

Bases: garage.replay_buffer.base.ReplayBuffer

This class implements HerReplayBuffer.

It constructs hindsight examples using future strategy.

sample(batch_size)[source]

Sample a transition of batch_size.

make_her_sample(replay_k, reward_fun)[source]

Generate a transition sampler for HER ReplayBuffer.

Parameters:
  • replay_k – the ratio between HER replays and regular replays
  • reward_fun – function to re-compute the reward with substituted goals
Returns: