- If you haven't yet, create a virtual environment.
python3 -m venv .venv
- Activate the environment.
source .venv/bin/activate
- Install the necessary libraries.
pip install -r requirements.txt
There are two scripts that must be run in order to generate the model checkpoints for each of the rounds: build_ev_table.py and trainer.py, in that particular order.
build_ev_table.pyscans all PHH hand-history files inside a training data folder, groups similar poker decision states into “buckets”, aggregates the hero’s final outcomes per action inside each bucket, and produces an EV lookup table for training the neural network.trainer.pyloads PHH-based training data and EV labels, trains a round-specific neural network to predict action EVs, uses early stopping based on validation agreement, and saves the best model checkpoint.
To obtain the model checkpoints, run python build_ev_table.py and then run
python trainer.py. All checkpoints will automatically be saved inside the
model_checkpoints folder.
To export the PyTorch models generated before, run the
export to ONNX script with python export_to_onnx.py.