All projects
Project

RL-Driven Blackjack Simulator with Action-Masking

Gym-compatible blackjack environment with partial observability and legality-aware action masking. PPO and DQN agents trained via Stable-Baselines3; DQN achieved a 49.4% loss rate, outperforming the house edge.

reinforcement-learningopen-source

Problem

Standard RL blackjack environments ignore partial observability and allow illegal actions, producing agents that don't transfer to realistic play.

Solution

Custom Gym-compatible environment with partial observability (hidden dealer card) and legality-aware action masking. Benchmarked PPO and DQN agents with Stable-Baselines3.

Impact

DQN agent achieved 49.4% loss rate, outperforming the house edge. Open-source benchmark for constrained-action RL environments.

Stack

PythonGymnasiumStable-Baselines3PyTorchNumPy