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: :param max_size: The maximum size of the memory. should be defined in a granularity of Transitions
  :param hindsight_transitions_per_regular_transition: The number of hindsight artificial transitions to generate
                                                       for each actual transition
  :param hindsight_goal_selection_method: The method that will be used for generating the goals for the
                                          hindsight transitions. Should be one of HindsightGoalSelectionMethod
  :param goals_space: A GoalsSpace which defines the base properties of the goals space
docstr_tok: [":","param","max_size",":","The","maximum","size","of","the","memory",".","should","be","defined","in","a","granularity","of","Transitions",":","param","hindsight_transitions_per_regular_transition",":","The","number","of","hindsight","artificial","transitions","to","generate","for","each","actual","transition",":","param","hindsight_goal_selection_method",":","The","method","that","will","be","used","for","generating","the","goals","for","the","hindsight","transitions",".","Should","be","one","of","HindsightGoalSelectionMethod",":","param","goals_space",":","A","GoalsSpace","which","defines","the","base","properties","of","the","goals","space"]
code: def __init__(
      self,
      max_size: Tuple[MemoryGranularity, int],
      hindsight_transitions_per_regular_transition: int,
      hindsight_goal_selection_method: HindsightGoalSelectionMethod,
      goals_space: GoalsSpace,
  ):
      """
      :param max_size: The maximum size of the memory. should be defined in a granularity of Transitions
      :param hindsight_transitions_per_regular_transition: The number of hindsight artificial transitions to generate
                                                           for each actual transition
      :param hindsight_goal_selection_method: The method that will be used for generating the goals for the
                                              hindsight transitions. Should be one of HindsightGoalSelectionMethod
      :param goals_space: A GoalsSpace which defines the base properties of the goals space
      """
      super().__init__(max_size)
  
      self.hindsight_transitions_per_regular_transition = (
          hindsight_transitions_per_regular_transition
      )
      self.hindsight_goal_selection_method = (
          hindsight_goal_selection_method
      )
      self.goals_space = goals_space
      self.last_episode_start_idx = 0
  
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 1 to create a new EpisodicHindsightExperienceReplay object from inherited base classes: EpisodicExperienceReplay with example: obj = EpisodicHindsightExperienceReplay(max_size, hindsight_transitions_per_regular_transition, hindsight_goal_selection_method, goals_space)