Counterfactual regret minimization algorithm for Kuhn poker
Switch branches/tags
Nothing to show
Clone or download
int8 Merge pull request #1 from kli-nlpr/patch-1
Latest commit 3b53512 Sep 26, 2018
Failed to load latest commit information.
games Update Sep 26, 2018
tests tests Sep 23, 2018
.gitignore .gitignore Sep 23, 2018 readme Sep 23, 2018
requirements.txt README + requirements.txt Sep 23, 2018

Implementation of counterfactual regret minimization algorithm for Kuhn poker in python

This is supplementary code for Counterfactual regret minimization blog post here

to install:

pip install -r requirements.txt

to run:

from common.constants import CARDS_DEALINGS
from games.kuhn import KuhnRootChanceGameState
from games.algorithms import ChanceSamplingCFR, VanillaCFR

root = KuhnRootChanceGameState(CARDS_DEALINGS)
chance_sampling_cfr = ChanceSamplingCFR(root) = 1000)
# read Nash-Equilibrum via chance_sampling_cfr.nash_equilibrium member
# try chance_sampling_cfr.value_of_the_game() function to get value of the game (-1/18)

# vanilla cfr
vanilla_cfr = VanillaCFR(root) = 1000)

# read Nash-Equilibrum via vanilla_cfr.nash_equilibrium member
# try vanilla_cfr.value_of_the_game() function to get value of the game (-1/18)

to run simple tests:

pytest tests/