Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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)
chance_sampling_cfr.run(iterations = 1000)
chance_sampling_cfr.compute_nash_equilibrium()
# 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)
vanilla_cfr.run(iterations = 1000)
vanilla_cfr.compute_nash_equilibrium()

# 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/

About

Counterfactual regret minimization algorithm for Kuhn poker

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.