This repo contains the official MDST implementation of DeepCFR1 written during the fall 24 semester, with the implementation transfered to the OpenSpiel2 environment.
In order to train and play against the model, install:
pip install -r requirements.txtOpenspiel provides libraries that calculate the exploitabilty of a policy. To run these, first execute the script to install the proper libraries:
./install_libs.shTo train the model run the command
python3 train_model.py --iterations 10 --K 5 --save_path "./cfr_model.pth" Which will train the DeepCFR model for 10 iterations per player, with 5 tree traversals per iteration, saving the final model into the file "cfr_model.pth". We trained this model for 300 iterations with 100 traversals per iterations, the resulting weights are provided in the file "cfr_model(300).pth".
To calculate the exploitability of a model, run:
python3 calculate_exploitability.py --model "path_to_model"This will calcuate the exploitability of whatever model you trained. Note that this is incredily memory intensive, and will most likley OOM crash if just ran on your local device.
If you want to play against the model, run
python3 play_model.py --opponent_model <path_to_model> --num_hands <num_hands>By default, this will play just 10 hands against the model we've already trained