Define goal-conditioned tasks
Specify state, goal representation and a sparse reward (success/failure) so relabelling makes sense; collect episodic rollouts.
Apply hindsight experience replay. Inspect goal relabelling effects.
Hindsight experience replay (HER) augments off-policy RL by relabelling failed episodes as if alternate goals were intended, turning sparse rewards into denser learning signals. Key engineering concerns include defining goal-conditioned states, maintaining a replay buffer with relabelled transitions, off-policy correction, and measuring sample efficiency and goal success rates under different relabelling strategies.
Learning concept · Not a validated service
Hindsight experience replay (HER) augments off-policy RL by relabelling failed episodes as if alternate goals were intended, turning sparse rewards into denser learning signals. Key engineering concerns include defining goal-conditioned states, maintaining a replay buffer with relabelled transitions, off-policy correction, and measuring sample efficiency and goal success rates under different relabelling strategies.
A proposed application: speed up robotic manipulation learning in simulation by relabelling unsuccessful grasp attempts as reaching alternative object poses. This extension is not implemented in the supplied starter code.
Specify state, goal representation and a sparse reward (success/failure) so relabelling makes sense; collect episodic rollouts.
Store episodes in a replay buffer and create extra training samples by replacing the intended goal with one achieved later in the episode.
Use a value or actor-critic method that can learn from relabelled off-policy transitions and track goal success rate per seed.
Measure goal success, sample efficiency and overfitting to relabelled goals; inspect relabelled examples that harm learning.
The supplied starter implements a simple epsilon-greedy multi-armed bandit experiment: four fixed Bernoulli arms, an online sample-average estimate for each arm, epsilon exploration, and printed action counts, estimated rates and cumulative reward. It does not implement episodic replay, a replay buffer, goal-conditioned transitions or any HER relabelling logic.
for step in range(1, 2001):
if rng.random() < epsilon:
action = rng.integers(len(true_reward_rates))
else:
action = int(np.argmax(estimated_values))
reward = 1 if rng.random() < true_reward_rates[action] else 0
action_counts[action] += 1
total_reward += reward
estimated_values[action] += (reward - estimated_values[action]) / action_counts[action]The code is a bandit-style epsilon-greedy estimator over four Bernoulli arms and contains no episodic environment, no replay buffer, and no goal relabelling mechanism — the core elements that define hindsight experience replay are absent.
Proposed extension: run a simulated pick-and-place or maze environment, store full episodes in a replay buffer, relabel goals from achieved states and train an off-policy value or actor-critic agent using the augmented transitions to improve sparse-reward learning.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.