Crushing Hearts with Deep CFR
Trains an AI model through self-play to compete against humans in the card game Hearts
Last verified:
Visit Crushing Hearts with Deep CFR
What is Crushing Hearts with Deep CFR?
Crushing Hearts With Deep CFR is a project that trains and serves an AI to play the card game Hearts using a simplified Deep Counterfactual Regret Minimization (Deep CFR) approach. The site describes a workflow where a neural network model is iteratively improved by self-play: the model plays many games against itself, regrets (differences between predicted and actual outcomes) are computed, and those regret samples are used to train the next model iteration. The project includes a training pipeline that requires a high-end GPU/CPU and takes multiple days, plus a web client and server so trained models can be loaded and played against in a browser. The site is aimed at researchers, hobbyists, and engineers interested in applied game-theory algorithms, deep learning for imperfect-information games, and running large self-play training runs. It highlights practical details for building/running the code (train, start server, run client) and notes where model files and TensorBoard logs are produced, making it useful for people who want to reproduce training or host a playable demo.
Crushing Hearts with Deep CFR pricing
Pricing model: Freemium
The project is open-source and available on the website/GitHub with no pricing or paid plans; there is no hosted commercial tier described—users download and run code locally for free. All code, instructions, and the playable web client are provided without charge; running training may incur compute costs if using paid cloud GPU instances.
Crushing Hearts with Deep CFR pros
- Implements Deep CFR specifically adapted for Hearts
- End-to-end code: training pipeline, server, and web client
- Playable online demo to test trained models
- Uses self-play to generate regret samples automatically
- Model checkpointing and clear Models directory convention
- TensorBoard-compatible logging for training monitoring
- Instructions for running locally and on a machine with GPU
- Source code is open and reproducible on GitHub
- Lightweight web client runnable with npm
- Separation of training and serving components for modularity
- Provides an AdvantageModel naming convention for deployment
- Community discussion and issue references linked from project
- Simplified Deep CFR variant reduces implementation complexity
- Demonstrates practical GPU/CPU requirements and run time expectations
- Worked example useful for learning CFR and self-play workflows
Crushing Hearts with Deep CFR cons
- Requires a high-end GPU and CPU for realistic training runs
- Training can take several days to produce strong models
- Not yet at expert-level play according to author notes
- No hosted paid service—user must run training and server themselves
- Model performance details and evaluation metrics are limited on the site
- No packaged installers; building requires compiling multiple projects
- Documentation assumes familiarity with TensorBoard and ML tooling
- Web demo requires copying a trained model into server runtime
Frequently asked questions about Crushing Hearts with Deep CFR
How do I train a Hearts model?
Build and run the training program (Hearts.Learn) as described on the site; training requires a high-end GPU and CPU and will take several days to complete, during which models and TensorBoard logs are saved to the repository's Models and runs directories.
Can I play against a trained model in my browser?
Yes—after building and running the web server and copying a trained model (renamed to AdvantageModel.pt) into the server's runtime directory, you can start the web client (npm install and npm start) and browse to the local server to play.
What hardware do I need to reproduce the results?
The site recommends a high-end computer with a fast GPU and CPU for training; without such hardware, training will be very slow or impractical, though smaller experiments may run on lesser hardware for development.
How long does training take?
The author states training will take several days for full runs on suitable hardware; exact time depends on GPU/CPU performance, chosen training iterations, and dataset size generated by self-play.
Where are model files and logs stored?
Trained models are saved to the Models directory and training progress can be tracked via TensorBoard logs written to the runs directory as described in the repository instructions.
Do I need to use OpenSpiel for this project?
No—the project implements a simplified Deep CFR approach independently; the author specifically notes they did not use OpenSpiel but considered the community might be interested in the approach.
Is the trained AI at expert human level?
The author indicates the resulting model is significantly better than many existing Hearts AIs but is not yet at expert-level play, so it may play strong but imperfect games.
What code components must I build?
You must build the training program (Hearts.Learn), the web server (Hearts.Web.Server), and optionally the server harness (Hearts.Web.Harness); you then run the client in the Hearts.Web/Client directory with npm to start the browser UI.
How do I deploy a trained model to the web server?
Copy a trained model file into the web server's runtime directory (e.g., ./bin/Debug or ./bin/Release) and rename it to AdvantageModel.pt, then restart the server so the web client can load and use the model.
Are there logs and monitoring for training?
Yes—training emits TensorBoard logs; the repository shows an example tensorboard command to bind and view logs from the runs directory so you can monitor losses and other metrics during training.