def get_transitions_forward_steps(self, indexes, forward_steps, discount_factor):
frame_batch_shape = (<EOL>[indexes.shape[<NUM_LIT:0>], indexes.shape[<NUM_LIT:1>]]<EOL>+ list(self.state_buffer.shape[<NUM_LIT:2>:-<NUM_LIT:1>])<EOL>+ [self.state_buffer.shape[-<NUM_LIT:1>] * self.frame_history]<EOL>)<EOL>simple_batch_shape = [indexes.shape[<NUM_LIT:0>], indexes.shape[<NUM_LIT:1>]]<EOL>past_frame_buffer = np.zeros(frame_batch_shape, dtype=self.state_buffer.dtype)<EOL>future_frame_buffer = np.zeros(frame_batch_shape, dtype=self.state_buffer.dtype)<EOL>reward_buffer = np.zeros(simple_batch_shape, dtype=np.float32)<EOL>dones_buffer = np.zeros(simple_batch_shape, dtype=bool)<EOL>for buffer_idx, frame_row in enumerate(indexes):<EOL><INDENT>for env_idx, frame_idx in enumerate(frame_row):<EOL><INDENT>past_frame, future_frame, reward, done = self.get_frame_with_future_forward_steps(<EOL>frame_idx, env_idx, forward_steps=forward_steps, discount_factor=discount_factor<EOL>)<EOL>past_frame_buffer[buffer_idx, env_idx] = past_frame<EOL>future_frame_buffer[buffer_idx, env_idx] = future_frame<EOL>reward_buffer[buffer_idx, env_idx] = reward<EOL>dones_buffer[buffer_idx, env_idx] = done<EOL><DEDENT><DEDENT>actions = take_along_axis(self.action_buffer, indexes)<EOL>transition_tensors = {<EOL>'<STR_LIT>': past_frame_buffer,<EOL>'<STR_LIT>': actions,<EOL>'<STR_LIT>': reward_buffer,<EOL>'<STR_LIT>': future_frame_buffer,<EOL>'<STR_LIT>': dones_buffer.astype(np.float32),<EOL>}<EOL>for name in self.extra_data:<EOL><INDENT>transition_tensors[name] = take_along_axis(self.extra_data[name], indexes)<EOL><DEDENT>return transition_tensors<EOL>
Get dictionary of a transition data - where the target of a transition is
n steps forward along the trajectory. Rewards are properly aggregated according to the discount factor,
and the process stops when trajectory is done.