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

Method store

rl3/ddpg.py:68–75  ·  view source on GitHub ↗
(self, obs, act, rew, next_obs, done)

Source from the content-addressed store, hash-verified

66 self.ptr, self.size, self.max_size = 0, 0, size
67
68 def store(self, obs, act, rew, next_obs, done):
69 self.obs1_buf[self.ptr] = obs
70 self.obs2_buf[self.ptr] = next_obs
71 self.acts_buf[self.ptr] = act
72 self.rews_buf[self.ptr] = rew
73 self.done_buf[self.ptr] = done
74 self.ptr = (self.ptr+1) % self.max_size
75 self.size = min(self.size+1, self.max_size)
76
77 def sample_batch(self, batch_size=32):
78 idxs = np.random.randint(0, self.size, size=batch_size)

Callers 1

ddpgFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected