MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / add_experience

Method add_experience

rl2/atari/dqn_tf.py:99–114  ·  view source on GitHub ↗

Args: action: An integer-encoded action frame: One grayscale frame of the game reward: reward the agend received for performing an action terminal: A bool stating whether the episode terminated

(self, action, frame, reward, terminal)

Source from the content-addressed store, hash-verified

97 self.indices = np.empty(self.batch_size, dtype=np.int32)
98
99 def add_experience(self, action, frame, reward, terminal):
100 """
101 Args:
102 action: An integer-encoded action
103 frame: One grayscale frame of the game
104 reward: reward the agend received for performing an action
105 terminal: A bool stating whether the episode terminated
106 """
107 if frame.shape != (self.frame_height, self.frame_width):
108 raise ValueError('Dimension of frame is wrong!')
109 self.actions[self.current] = action
110 self.frames[self.current, ...] = frame
111 self.rewards[self.current] = reward
112 self.terminal_flags[self.current] = terminal
113 self.count = max(self.count, self.current+1)
114 self.current = (self.current + 1) % self.size
115
116 def _get_state(self, index):
117 if self.count is 0:

Callers 2

play_oneFunction · 0.45
dqn_tf.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected