A simple Q-learning implementation to solve the FrozenLake environment from OpenAI Gymnasium.
The agent learns to navigate a frozen lake to reach a goal while avoiding holes using Q-learning reinforcement learning algorithm.
pip install numpy gymnasiumpython main.py- Episodes: 10,000 training episodes
- Learning rate: 0.1
- Discount rate: 0.99
- Exploration rate: Decays from 1.0 to 0.01
- Initial Q-table (all zeros)
- Average reward per 1000 episodes during training
- Final trained Q-table
The agent starts with random exploration and gradually learns optimal actions through trial and error.
Code adapted from: DeepLizard Q-Learning Tutorial


