CFR-rs is a rust implementation of Counterfactual Regret Minimization[1].
The library calculates ε-Nash equilibrium of all Imperfect-Information Extensive-Form Game satisfying
- finite
- two-person
- zero-sum
- perfect recall
- relatively small
This library reads all the rules of a game from a JSON file. The implementation is not specific to any particular game, so you can analyze any game that meets the above conditions.
You can calculate an ε-Nash equilibrium strategy for Kuhn poker in 1,000,000
steps.
$ cargo build --release --bin main
$ RUST_LOG=debug target/release/main --rule src/rule/kuhn.json --step 1000000
- Rule: Kuhn poker, an extremely simplified form of poker.
- Step:
1,000,000
- Environments:
- 3.2 GHz CPU
- 8 GB RAM
The library calculates a strategy in 16.8 ± 0.7
sec.
The value of NashConv, A common metric for determining the rates of convergence, decreases in O(1/√step)
.
[1] Zinkevich, Martin, et al. "Regret minimization in games with incomplete information." Advances in neural information processing systems 20 (2007): 1729-1736.