a guest Jul 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def step(self, state, action, reward, next_state, done):
  2.         """Save experience in replay memory, and use random sample from buffer to learn."""
  3.         # Save experience / reward
  4.         self.memory.add(state, action, reward, next_state, done)
  6.         # Learn, if enough samples are available in memory
  7.         if len(self.memory) > BATCH_SIZE:
  8.             experiences = self.memory.sample()
  9.             self.learn(experiences, GAMMA)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand