Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created July 20, 2019 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/41272b58f9185c39dfe0b09a64b6b9a6 to your computer and use it in GitHub Desktop.
Save NMZivkovic/41272b58f9185c39dfe0b09a64b6b9a6 to your computer and use it in GitHub Desktop.
def act(self, frame):
if np.random.rand() <= self.epsilon:
return self.enviroment.action_space.sample()
frame = np.expand_dims(np.asarray(frame).astype(np.float64), axis=0)
q_values = self.q_network.predict(frame)
return np.argmax(q_values[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment