1. Learn
  2. /
  3. Courses
  4. /
  5. Reinforcement Learning with Gymnasium in Python

Connected

Exercise

Solving CliffWalking with decayed epsilon-greedy strategy

Enhancing the epsilon-greedy strategy, a decay factor is introduced to gradually decrease the exploration rate, epsilon, as the agent learns more about the environment. This approach promotes exploration in the early stages of learning and exploitation of the learned knowledge as the agent becomes more familiar with the environment. Now, you'll apply this strategy to solve the CliffWalking environment.

The environment has been initialized, and can be accessed by the variable env. The variables epsilon, min_epsilon, and epsilon_decay have been pre-defined for you. The functions epsilon_greedy() and update_q_table() have been imported.

Instructions

100 XP
  • Implement the full training loop by choosing an action, executing it, accumulating the reward received to episode_reward, updating the Q-table.
  • Decrease epsilon using the epsilon_decay rate, ensuring it does not fall below min_epsilon.