Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def step(self, state, action, reward, next_state, done):
- """Save experience in replay memory, and use random sample from buffer to learn."""
- # Save experience / reward
- self.memory.add(state, action, reward, next_state, done)
- # Learn, if enough samples are available in memory
- if len(self.memory) > BATCH_SIZE:
- experiences = self.memory.sample()
- self.learn(experiences, GAMMA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement