class_docstr: Implements Hindsight Experience Replay as described in the following paper: https://arxiv.org/pdf/1707.01495.pdf
class_docstr_tok: ["Implements","Hindsight","Experience","Replay","as","described","in","the","following","paper",":","https",":","\/\/arxiv.org\/pdf\/1707.01495.pdf"]
docstr: Sample a batch of goal states according to the sampling method
  :param episode_transitions: a list of all the transitions in the current episode
  :param transition_index: the transition to start sampling from
  :return: a goal corresponding to the sampled state
docstr_tok: ["Sample","a","batch","of","goal","states","according","to","the","sampling","method",":","param","episode_transitions",":","a","list","of","all","the","transitions","in","the","current","episode",":","param","transition_index",":","the","transition","to","start","sampling","from",":","return",":","a","goal","corresponding","to","the","sampled","state"]
code: def _sample_goals(
      self, episode_transitions: List, transition_index: int
  ):
      """
      Sample a batch of goal states according to the sampling method
      :param episode_transitions: a list of all the transitions in the current episode
      :param transition_index: the transition to start sampling from
      :return: a goal corresponding to the sampled state
      """
      return [
          self._sample_goal(episode_transitions, transition_index)
          for _ in range(
              self.hindsight_transitions_per_regular_transition
          )
      ]
  
imports: import copy
  from enum import Enum
  from typing import Tuple, List
  import numpy
  from rl_coach.core_types import Episode, Transition
  from rl_coach.memories.episodic.episodic_experience_replay import EpisodicExperienceReplayParameters, EpisodicExperienceReplay
  from rl_coach.memories.non_episodic.experience_replay import MemoryGranularity
  from rl_coach.spaces import GoalsSpace
label_desc: Use image node_id 3 for calling the EpisodicHindsightExperienceReplay obj's underlying member method code with example usage: obj._sample_goals(episode_transitions, transition_index) and returns: unknown