Created
August 25, 2020 16:23
-
-
Save Danaze/714e161acc05b1c4d07b78a89711e559 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 QLupdate(self, state, action, reward, new_state): | |
# updating the Q-value of the visited state-action pair | |
self.Q_table[state][action] += self.learning_rate * (reward + self.discount * np.max(self.Q_table[new_state]) - self.Q_table[state][action]) | |
def SARSAupdate(self, state, action, reward, new_state, next_action): | |
# updating the Q-value of the visited state-action pair | |
self.Q_table[state][action] += self.learning_rate * (reward + self.discount * self.Q_table[new_state][next_action] - self.Q_table[state][action]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment