Skip to content

Counterfactual Regret Minimization Game solution methods for Julia

License

Notifications You must be signed in to change notification settings

dannywinrow/CounterfactualRegret.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CounterfactualRegret.jl

Finding NE with Regret Matching

using CounterfactualRegret
using Plots

RPS = MatrixGame([
    (0,0) (-1,1) (1,-1);
    (1,-1) (0,0) (-1,1);
    (-1,1) (1,-1) (0,0)
])

init_strategy = [0.1,0.2,0.7]

p1 = MatrixPlayer(RPS, 1, copy(init_strategy))
p2 = MatrixPlayer(RPS, 2, copy(init_strategy))

train_both!(p1, p2, 10_000)
plot(p1, p2, lw=2)

Finding NE with CFR

game = SimpleIIGame([
    (0,0) (-1,1) (1,-1);
    (1,-1) (0,0) (-1,1);
    (-1,1) (1,-1) (0,0)
])

p1 = SimpleIIPlayer(game,1, [0.1,0.2,0.7])
p2 = SimpleIIPlayer(game,2, [0.1,0.2,0.7])

train_both!(p1,p2,1000)
plot(p1, p2, lw=2)

Exploiting static opponent with CFR

p1 = SimpleIIPlayer(game,1, [0.1,0.2,0.7])
p2 = SimpleIIPlayer(game,2, [0.1,0.2,0.7])
train_one!(p1,p2,100)
plot(p1, p2, lw=2)

About

Counterfactual Regret Minimization Game solution methods for Julia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Julia 100.0%