Mountain Car

Watch a pre-trained AI agent solve this classic control problem!

Goal: Reach the flag on the right peak

About This Model

This agent was trained using Deep Q-Network (DQN) with Stable Baselines3, a state-of-the-art reinforcement learning library in Python. The trained model was then converted to TensorFlow.js to run directly in your browser.

Training Details

How It Learned

The agent learned through trial and error, discovering the optimal strategy through 120,000 environment interactions. It receives a small penalty for each time step, incentivizing it to reach the goal quickly.

Through exploration and learning, it discovered that building momentum by rocking back and forth is key to reaching the goal on the right peak.

Technical Implementation

View the code:
Custom Gym Environment | Training Script | Model Converter | Browser Inference Code