Duc Phat Nguyen

A student looking for opportunities in Data Science & AI

Project Mario RL Thumbnail

Play Mario with Reinforcement Learning

A Double Deep Q-Learning implementation that teaches an AI agent to play Super Mario Bros through trial and error. I wrote a blog post about this project here!

View on GitHub

Built With

Python Badge PyTorch Badge OpenAI Badge NumPy Badge Matplotlib Badge

This project implements a Double Deep Q-Learning (DDQN) model to teach an AI agent to play Super Mario Bros. The agent learns through trial and error, developing strategies to navigate levels, avoid enemies, and maximize score. The implementation uses PyTorch for deep learning and OpenAI Gym for the game environment.

The project involved several key components:

  1. Environment Setup:
    • Integration with OpenAI Gym's Super Mario Bros environment
    • State preprocessing and action space definition
    • Reward function design to encourage desired behaviors
  2. Model Architecture:
    • Implementation of a DDQN model with target network for stability
    • Experience replay buffer to store and sample past experiences
    • Training loop to update the model based on rewards and penalties
  3. Training Pipeline:
    • Training the agent on episodes of Super Mario Bros with Epsilon-greedy exploration strategy
    • Monitoring performance metrics and checkpoints
    • Periodic target network updates

Agent Performing Captures

Mario Gameplay - 1st Train

Mario Gameplay checkpoint 1 - 2nd Train

Mario Gameplay checkpoint 2 - 2nd Train

Mario Gameplay last checkpoint - 2nd Train

Workflow

Coming soon

Results

Coming soon

Visit the GitHub Repository

For the full code and documentation, visit the GitHub repository.