CoolFace
Apppublic

ChenyuEcho/texas-holdem-ppo

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

๐ŸŽฐ Texas Hold'em PPO Agent

Play heads-up Texas Hold'em poker against AI agents trained with Proximal Policy Optimization (PPO)!

๐ŸŽฎ Features

  • โ€”Multiple AI Opponents: Choose from CNN or MLP-based agents at different training stages
  • โ€”Real-time Game Info: Track pot size and bet amounts
  • โ€”Professional UI: Casino-themed dark interface
  • โ€”Fair Play: Watch agent actions and see cards in real poker order

๐Ÿค– Available Models

  • โ€”Stage 1: Early training agents (vs rule-based opponents)
  • โ€”Stage 2: Improved agents (fine-tuned vs frozen agents)
  • โ€”Stage 3: Final agents (advanced fine-tuning)

Each stage available in both:

  • โ€”CNN: Card-aware convolutional network (~357k params)
  • โ€”MLP: Pure multi-layer perceptron (~120k params)

๐ŸŽฏ How to Play

  1. 1.Select an opponent from the dropdown
  2. 2.Set your starting chips
  3. 3.Click "๐ŸŽฒ New Match" to begin
  4. 4.Use action buttons: Call, Raise, Fold, or Check
  5. 5.Try different opponents to test various strategies!

๐Ÿง  Architecture

Trained using PPO with a three-stage curriculum:

  • โ€”Stage 1: Multiple agents vs rule-based opponents
  • โ€”Stage 2: Fine-tuning with replay buffer
  • โ€”Stage 3: Advanced refinement

See the GitHub repository for training details and source code.

๐Ÿ“Š Model Comparison

Compare CNN vs MLP architectures to see which performs better:

  • โ€”CNN uses card-structure inductive bias
  • โ€”MLP processes features directly
  • โ€”Both trained with identical hyperparameters

Built with PettingZoo, PyTorch, and Gradio