Skip to content

yongjinjiang/Reinforcement-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ Reinforcement Learning Journey

An interactive web application documenting my systematic exploration of Reinforcement Learning algorithms, built with math and physics intuition.

๐ŸŒŸ Project Overview

This project serves multiple purposes:

  • Personal Learning: A structured approach to mastering RL from first principles
  • Interactive Documentation: Each algorithm includes theory, implementation, and runnable demos
  • Portfolio Showcase: Demonstrating technical skills and learning methodology
  • Knowledge Sharing: Making RL accessible through interactive explanations

โœจ Features

๐ŸŽ“ Educational Content

  • Slide-based Theory: Each algorithm has comprehensive slides explaining concepts
  • Interactive Code: Python implementations running directly in the browser via PyScript
  • Learning Notes: Personal insights, questions, and connections to math/physics
  • Progressive Learning: Algorithms ordered from foundational to advanced

๐Ÿ› ๏ธ Technical Stack

  • Frontend: Pure HTML/CSS/JavaScript (no build process needed)
  • Python Execution: PyScript - Run Python in the browser
  • Syntax Highlighting: Prism.js - Beautiful code display
  • Deployment: GitHub Pages (static site hosting)
  • Styling: Custom CSS with modern design and dark theme

๐ŸŽจ Design Principles

  • Clean & Modern: Professional dark theme optimized for readability
  • Fully Responsive: Works seamlessly on desktop, tablet, and mobile
  • Interactive: Live code execution, slide navigation, smooth animations
  • Accessible: Keyboard navigation, semantic HTML, high contrast

๐Ÿ“š Algorithm Coverage

โœ… Implemented

  1. Multi-Armed Bandit
    • ฮต-greedy strategy
    • Upper Confidence Bound (UCB)
    • Thompson Sampling
    • Interactive comparison demo

๐Ÿšง Coming Soon

  1. Q-Learning - Temporal Difference learning for discrete spaces
  2. SARSA - On-policy TD control
  3. Policy Gradient - Direct policy optimization (REINFORCE)
  4. Deep Q-Network (DQN) - Deep RL with experience replay
  5. Actor-Critic - Hybrid value and policy methods
  6. PPO - Proximal Policy Optimization
  7. A3C - Asynchronous Advantage Actor-Critic

๐Ÿš€ Getting Started

Local Development

  1. Clone the repository

    git clone https://github.com/yourusername/Reinforcement-Learning.git
    cd Reinforcement-Learning
  2. Open in browser Simply open index.html in your web browser. No build process required!

    Or use a local server:

    # Python
    python -m http.server 8000
    
    # Node.js
    npx serve
    
    # VS Code
    # Use "Live Server" extension
  3. Navigate to: http://localhost:8000

Project Structure

Reinforcement-Learning/
โ”œโ”€โ”€ index.html                          # Main landing page
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ styles.css                      # Global styles
โ”œโ”€โ”€ js/
โ”‚   โ””โ”€โ”€ main.js                         # Main JavaScript
โ”œโ”€โ”€ algorithms/
โ”‚   โ””โ”€โ”€ multi-armed-bandit/
โ”‚       โ”œโ”€โ”€ index.html                  # Algorithm page with slides
โ”‚       โ”œโ”€โ”€ algorithm.css               # Page-specific styles
โ”‚       โ””โ”€โ”€ mab_demo.py                 # Python implementation
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ images/                         # Images and diagrams
โ””โ”€โ”€ README.md                           # This file

๐ŸŒ Deploying to GitHub Pages

Option 1: GitHub Settings (Easiest)

  1. Push your code to GitHub

    git add .
    git commit -m "Initial commit: RL Journey web app"
    git branch -M main
    git remote add origin https://github.com/yourusername/Reinforcement-Learning.git
    git push -u origin main
  2. Enable GitHub Pages

    • Go to your repository on GitHub
    • Click "Settings" โ†’ "Pages"
    • Under "Source", select "main" branch and "/" root
    • Click "Save"
  3. Access your site

    • Your site will be live at: https://yourusername.github.io/Reinforcement-Learning/
    • It may take a few minutes to deploy

Option 2: GitHub Actions (Advanced)

Create .github/workflows/deploy.yml:

name: Deploy to GitHub Pages

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./

๐ŸŽฏ Learning Philosophy

This project embodies a unique learning approach:

๐Ÿงฎ Mathematical Rigor

  • Building intuition from first principles
  • Leveraging math and physics background
  • Deriving formulas and understanding proofs

๐Ÿ”ฌ Hands-on Experimentation

  • Every concept includes runnable code
  • Interactive parameters to explore behavior
  • Visualizations of algorithm performance

๐Ÿค” Question-Driven Learning

  • Documenting questions and insights
  • Exploring "why" not just "how"
  • Connecting concepts across domains

๐Ÿค AI-Assisted Development

  • Using Claude Code, GitHub Copilot for implementation
  • Leveraging AI for explanations and debugging
  • Demonstrating modern development workflow

๐Ÿ’ก How to Use This Project

For Learning

  1. Start with Multi-Armed Bandit - Foundation concepts
  2. Read the slides - Understand theory step-by-step
  3. Review learning notes - See thought process and insights
  4. Run the code - Modify parameters and experiment
  5. Ask questions - Use AI tools to deepen understanding

For Employers/Reviewers

  • Demonstrates self-directed learning ability
  • Shows technical implementation skills (web dev + ML)
  • Exhibits communication through clear documentation
  • Proves modern tooling proficiency (PyScript, Git, etc.)

For Contributors

Contributions welcome! To add an algorithm:

  1. Create folder: algorithms/algorithm-name/
  2. Add index.html with slides and code
  3. Add algorithm.css for custom styling
  4. Include .py implementation file
  5. Update main index.html with new card
  6. Submit PR with description

๐Ÿ”ง Technologies Used

Technology Purpose Why Chosen
PyScript Run Python in browser No backend needed, pure frontend solution
Prism.js Syntax highlighting Beautiful, lightweight, extensible
Pure CSS Styling Full control, no framework overhead
GitHub Pages Hosting Free, integrated with Git, easy deployment
NumPy (via Pyodide) Scientific computing Standard for numerical Python

๐Ÿ“ˆ Future Enhancements

  • Add visualization library (Plotly.js/D3.js)
  • Implement algorithm comparison dashboard
  • Add Jupyter notebook integration
  • Create video walkthroughs
  • Add search functionality
  • Implement dark/light theme toggle
  • Add progress tracking system
  • Include quiz/exercise sections

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿ™ Acknowledgments

  • Built with PyScript
  • Syntax highlighting by Prism.js
  • Developed with assistance from Claude (Anthropic) and GitHub Copilot
  • Inspired by the RL community and open-source learning resources

๐Ÿ“ž Contact

Author: [Your Name]


Built with โค๏ธ, curiosity, and a deep appreciation for the beauty of reinforcement learning

Last updated: November 2024

About

interactive RL playground with condensed mathematical introductions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors