Last active
February 5, 2019 19:27
-
-
Save lsimmons2/2a1ec000f2f7c8ccae552d76ab1a6365 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def act(self, state): | |
if self.epsilon > np.random.rand(): | |
# explore | |
return np.random.choice(ACTION_SPACE) | |
else: | |
# exploit - only use the online network to decide which action to take | |
# if allowed by epsilon/the exploration factor | |
state = self._reshape_state_for_net(state) | |
q_values = self.online_network.predict(state)[0] | |
return np.argmax(q_values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment