From 595bee95c4951f4bd582b39da6c4de08894b9b5b Mon Sep 17 00:00:00 2001 From: LeoQuentin Date: Sat, 10 Feb 2024 18:22:28 +0100 Subject: [PATCH] deleted old files --- reinforcement_learning/.DS_Store | Bin 6148 -> 0 bytes .../Q_Learning/Frozen_Lake_Q.py | 41 ------------------ 2 files changed, 41 deletions(-) delete mode 100644 reinforcement_learning/.DS_Store delete mode 100644 reinforcement_learning/Q_Learning/Frozen_Lake_Q.py diff --git a/reinforcement_learning/.DS_Store b/reinforcement_learning/.DS_Store deleted file mode 100644 index 329ab26df6fa89bd6d8a98cac00a7b0c5b445363..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5S?wSO%g77fO1>4!a(LhkxsJo`ud zJ36zw6{Ys5Seb#@H`$$+Y+jb#3;>8~uTcWX1Av20n95=EjnO#yn5Aq_8d2zb_|S$J zLiC%lZ0`7r3edNkgCnTJAvEFB_dAHxbr7il$7yjqqp!Vb!)O90=yzI{^Afb8u+uFT zUqvdNnVHQxS!dq4^lnw(>-ybZr|P%Q>FPwOC>X_la2huI_59+Vio1RoH`|&JHkz1n zaTdl6)vu~v+~{boX9k>{ldI=f27^*%yIhdv($=sb2Rj?Zg4`@uhQpk*w7R}~T)&I% zWA&(~4+0mgwgrnLc*5XYK_0wz9I2QV_J}*;FtP%y04p$M3fOJTnV+(G^K@AOR^aCq zp#4Fj6S@`?gL>=0MwbAH8SK`EG5szQM_P0(CI)c?O&BVop$c1K2t&tyY4co*i9tgL zVT%u8pDb*JBJ|Vo{!*uda1C self.epsilon: - action = self.greedy_action_choice(state) - else: - action = np.random.choice(range(self.action_space)) - self.decrement_epsilon() - return action - - def decrement_epsilon(self): - self.epsilon = max(self.epsilon_minimum, self.epsilon - self.epsilon_decay) - - def greedy_action_choice(self, state): - action = self.Q_table.iloc[:, state].idxmax() - return int(action.split(" ")[-1]) - - def learn(self, old_state, action, reward, new_state): - Q_observed = reward + self.gamma * self.Q_table.iloc[:, new_state].max() - Q_expected = self.Q_table.at[f"Action {action}", f"State {old_state}"] - self.Q_table.at[f"Action {action}", f"State {old_state}"] = Q_expected + self.lr * (Q_observed - Q_expected) - -